C- Functions Question and Answer

C- Functions Question and Answer
61. Find the output
void main ( )
{
printf("%u",main));
}
  • Garbage value
  • Run time error
  • Printing starting address of function main
  • Infinite loop
Show Answer
62. Find the output
void main ()
{
show (5);
}
show (int x)
{
static int i=1;
while (i++<5)
{
show (++x);
printf("%d",x);
}

  • 6 7 8 9
  • 9 8 7 6
  • 6 6 6 6
  • None of these
Show Answer
63. Find the output
void main ()
{
int pascal show (int);
show (5);
}
pascal show (int x, int y)
{
printf ("%d %d", x,y);
}

  • 0 5
  • 5 0
  • 0 0
  • Compilation error
Show Answer
64. A functions return type may not be
  • Double constant
  • An array
  • A pointer
  • A pointer to another pointer
Show Answer
65. 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;
}

  • 3
  • 5
  • Can't return more than one value
  • Function should have a return type
Show Answer
66. Find the output
void main ( )
{
int i =5;
printf ("i=%d", i);
show ( );
printf ("i=%d",i);
}
show ( )
{
int i;
i=1;
return i;
}

  • i=5 i=5
  • i=5 i=1
  • Function should have a return type
  • Multiple declarations of i
Show Answer
67. Find out the false statement
  • A program by default sends integer type parameters.
  • A function can be a part of an expression.
  • Size of a function can be measured using sozeof () operator.
  • A stack frame is created in memoy for each function call.
Show Answer
68. Find the output
int x=5;
{
int *p;
int *find( );
p=find (  );
printf("%d", *p);
}
int *find ( )
{
int x=10;
return &x;
}
  • 10
  • 5
  • Garbage
  • None of these
Show Answer
69. Find the output
int main (int x)
{
if (k<10)
printf("%d ",main (k+1));
return k;
}


  • 2 3 4 5 6 7 8 9 10
  • 10 9 8 7 6 5 4 3 2
  • Compilation error
  • None of thesde
Show Answer
70. Find the output
void main ( )
{
int i=1;
while (i++<5)
printf("%d", call (i));
}
call (int i)
{
return --i;
}

  • 1 2 3 4
  • 0 1 2 3
  • Function should return a value
  • 0 0 0 0
Show Answer
Questions and Answers for Competitive Exams Various Entrance Test