Programming in C - Functions and Recursions

23. The following program
main ()
{ int a = 4;
 change { a };
 printf ("%d", a);
}
change (a)
int a;
{
printf("%d", ++a);
}
outputs

  • Option : C
  • Explanation :
    change (a) , prints 5 but the value of 'a' in main ( ) is still 4. So main( ) will print 4.
Cancel reply
Cancel reply

25. The following program
main()
{
int abc();
abc ();
( *abc) ();
}
int abc( )
{
printf ("come");
}

  • Option : B
  • Explanation :
    The function abc can be invoked as abc( ) or ( *abc ) ( ). Both are two different ways of doing the same thing.
Cancel reply
Cancel reply