C Functions Questions and Answers
C Functions Questions with Answers provide an in-depth look at one of the most fundamental concepts in C programming. Understanding how to define, call, and manage user-defined and library functions is key to mastering structured programming. These C programming MCQs are widely used in technical interviews and coding tests conducted by companies like TCS, Wipro, and Infosys. Each question includes explanations to help you grasp parameter passing, recursion, return types, and scope. Practicing programming questions with answers strengthens your coding logic and prepares you for real-world software challenges. Download C programming MCQ PDFs and practice online to enhance your technical aptitude efficiently.
C Functions
Showing 10 of
151 questions
102. Find the output. void main ( ) { int x, y=5; x=come (y); y=go (x); printf("%d",x); printf ("%d", y); } come (int x) { if (x) return x++; else return x--; } go (int y) { if (y) return y++; else return y--; }
- 55
- 67
- 43
- None of these
103. Find the output. void main ( ) { char *p="cite"; char *q="good"; if (strcmp (p,q)) printf ("equal"); else printf("not equal"); }
- equal
- not equal
- Compilation error
- None of these
104. Find the output void main ( ) { char c [ ] = "rama"; put (c); } put (char *p) { while (++*p) printf("%c", *p); }
- rama
- ama
- ama\0
- none of these
105. Find the output. int a [ ] = {a, 3, 5, 7}; int count; add ( ) { return ++count; } void main ( ) { a [count++]=add ( ); pintf ("%d", a[count]); }
- 3
- 4
- 5
- None of these
106. Find the output void main ( ) { int a [ ] = {1, 2, 3, 4, 5}, i=0; while (a[i]) callme (a[i++]); for (i=0;i<5;i++) printf("%d", a [i]); } callme (int x) { *(&x)=x+1; }
- 1 2 3 4 5
- 2 3 4 5 6
- No output
- None of these
107. The function strcat( ) append what value at the end of the string ?
- NULL
- '\0'
- Nothing
- None of these
108. Find the output void main( ) { void rev (int); rev (3); } void rev (int v) { if (n>0) rev (--n); printf("%d",n); }
- 0012
- 123
- 012
- None of these
109. Find the output void main ( ) { int i=1; do { printf("%d",i); } while (end (i)); } end (int i) { i--; }
- 1
- Print 1 infinite time
- Error, function should return a value
- None of these
110. Find the output void main ( ) { f ( ); f ( ); } f ( ) { static i=1; printf("%d", i++); }
- 11
- 12
- 13
- None of these