Functions and Pointers in C language MCQs

@T-Bone

This question paper focuses on the "Functions And Pointers" of the C programming. These Multiple Choice Questions (MCQ) should be practiced to improve the C programming skills required for various interviews (campus interview, walk-in interview, company interview), placement, entrance exam, and other competitive examinations.

This question paper focuses on the "Functions And Pointers" of the C programming. These Multiple Choice Questions (MCQ) should be practiced to improve the C programming skills required for various interviews (campus interview, walk-in interview, company interview), placement, entrance exam, and other competitive examinations.

Questions

1. The keyword used to transfer control from a function back to the calling function is

Mark the correct option

2. What is the default return type if it is not specified in function definition?

Mark the correct option

3. The default parameter passing mechanism is

Mark the correct option

4. Pick the correct statements. I. The body of a function should have only one return statement II. The body of a function may have many return statements. III. function can return only one value to the calling environment. IV. If return statement is omitted, then the function does its job but returns no value to the calling environment.

Mark the correct option

5. Functions can return structure in c?

Mark the correct option

6. Forward declaration is absolutely necessary

Mark the correct option

7. In C, what is the meaning of following function prototype with empty parameter list void fun() { /* .... */ }

Mark the correct option

8. A pointer is

Mark the correct option

9. The reason for using pointers in a C program is

Mark the correct option

10. How can you write a[i][j][k][l] in equivalent pointer expression?

Mark the correct option

11. What is wild pointer?

Mark the correct option

12. Address stored in the pointer variable is of type __________.

Mark the correct option

13. In order to fetch the address of the variable we write preceding _________ sign before variable name.

Mark the correct option

14. Comment on this const int *ptr;

Mark the correct option

15. Choose the best one - prior to using a pointer variable

Mark the correct option

16. Which of the following statements are correct about the given program? #include <stdio.h> int main() { printf("%p", main()); return 0; }

Mark the correct option

17. What is the output of this program? #include <stdio.h> void fun(int a, ...) { printf("%d ", a); } int main() { fun(1,2,3,4); fun(5,6,7,8,9); return 0; }

Mark the correct option

18. What is the meaning of using static before function declaration? static int demo(int a, int b) { return (a + b); }

Mark the correct option

19. What is the output of this program? #include <stdio.h> int demo() { static int i = 0; printf("%d ",i++); } int main() { for(int j = 0 ; j < 5 ; j++ ) { demo(); } }

Mark the correct option

20. What is the output of this program? #include <stdio.h> int test() { static int n = 10; return n--; } int main() { for(test(); test(); test()) printf("%d ", test()); return 0; }

Mark the correct option

Index of Questions