Programming in C - Functions and Recursions

21. void can be used

Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


22. Any C program

Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


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

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


24. The following program
main()
{
inc(); inc(); inc();
}
inc()
{
static int x;
printf("%d", ++x);
}

Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


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

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *