What will be the output of this code?
int counter = 0;
void increment() { static int count = 0; count++; counter++; }
main() { increment(); increment(); printf("%d %d", count, counter); }
Q.362Easy
Which of the following is a correct function prototype in C?
Q.363Easy
What is the scope of a static function in C?
Q.364Easy
Which keyword is used to pass arguments by reference in C?
Q.365Medium
Which of the following correctly demonstrates function recursion termination?
Advertisement
Q.366Medium
What does the const qualifier do when applied to function parameters?
Q.367Medium
Which statement about extern functions is correct?
Q.368Medium
What is the primary purpose of function pointers in C?
Q.369Hard
How are function arguments evaluated in C?
Q.370Easy
What is the difference between declaring a function and defining a function?
Q.371Hard
In the context of function pointers, what does the restrict keyword do?
Q.372Medium
Which of the following is a valid way to return multiple values from a function in C?
Q.373Medium
What happens if a function is declared but never defined in C?
Q.374Medium
Consider a function that modifies an array passed as a parameter. Which statement is true?
Q.375Medium
What is the purpose of function inlining in modern C compilers?
Q.376Hard
Which of the following about variadic functions is true?
Q.377Hard
What is a callback function in C?
Q.378Hard
In C, what is the relationship between array parameters and pointers in functions?
Q.379Medium
Which of the following demonstrates proper use of the return statement in error handling?
Q.380Medium
A function in C is declared as: int calculate(int *arr, int size). When this function modifies the array elements, what happens to the original array passed from the calling function?