C Functions Questions and Answers

Practice Mode
Showing 10 of 151 questions
Q61
Find the output void main ( ) { printf("%u",main)); }
  • A Garbage value
  • B Run time error
  • C Printing starting address of function main
  • D Infinite loop
Answer: Option C
Q62
Find the output void main () { show (5); } show (int x) { static int i=1; while (i++<5) { show (++x); printf("%d",x); }
  • A 6 7 8 9
  • B 9 8 7 6
  • C 6 6 6 6
  • D None of these
Answer: Option B
Q63
Find the output void main () { int pascal show (int); show (5); } pascal show (int x, int y) { printf ("%d %d", x,y); }
  • A 0 5
  • B 5 0
  • C 0 0
  • D Compilation error
Answer: Option C
Q64
A functions return type may not be
  • A Double constant
  • B An array
  • C A pointer
  • D A pointer to another pointer
Answer: Option A
Q65
Find the output void main () { int x=10; x=callme (x); printf("%d",x); } callme (int x) { int i=5; x=x/2-3; return x,i; }
  • A 3
  • B 5
  • C Can't return more than one value
  • D Function should have a return type
Answer: Option B
Q66
Find the output void main ( ) { int i =5; printf ("i=%d", i); show ( ); printf ("i=%d",i); } show ( ) { int i; i=1; return i; }
  • A i=5 i=5
  • B i=5 i=1
  • C Function should have a return type
  • D Multiple declarations of i
Answer: Option A
Q67
Find out the false statement
  • A A program by default sends integer type parameters.
  • B A function can be a part of an expression.
  • C Size of a function can be measured using sozeof () operator.
  • D A stack frame is created in memoy for each function call.
Answer: Option C
Q68
Find the output int x=5; { int *p; int *find( ); p=find (  ); printf("%d", *p); } int *find ( ) { int x=10; return &x; }
  • A 10
  • B 5
  • C Garbage
  • D None of these
Answer: Option A
Q69
Find the output int main (int x) { if (k<10) printf("%d ",main (k+1)); return k; }
  • A 2 3 4 5 6 7 8 9 10
  • B 10 9 8 7 6 5 4 3 2
  • C Compilation error
  • D None of thesde
Answer: Option B
Q70
Find the output void main ( ) { int i=1; while (i++<5) printf("%d", call (i)); } call (int i) { return --i; }
  • A 1 2 3 4
  • B 0 1 2 3
  • C Function should return a value
  • D 0 0 0 0
Answer: Option A
Questions and Answers for Competitive Exams Various Entrance Test