Question 44
int fun(){ static int num = 16; return num--;}int main(){ for(fun(); fun(); fun()) printf(\"%d \", fun()); return 0;}
Question 45
Assuming int size is 4 bytes, what is going to happen when we compile and run the following program?
#include “stdio.h”
int main()
{
printf(“GeeksQuiz\\n”);
main();
return 0;
}
Question 47
What is the output of the following program?
#include int tmp=20; main( ) { printf("%d ",tmp); func( ); printf("%d ",tmp); } func( ) { static int tmp=10; printf("%d ",tmp); }
Question 48
If only one memory location is to be reserved for a class variable, no matter how many objects are instantiated, then the variable should be declared as
Question 50
Consider the following code:
int a, b, c = 0;
void prtFun(void);
void main()
{
static int a = 1;
prtFun();
a += 1;
prtFun() printf("\n %d %d ", a, b);
}
void prtFun(void)
{
static int a = 2;
int b = 1;
a += ++b;
printf("\n %d %d ", a, b);
}
What output will be generated by the given code d\\segment if:
Line 1 is replaced by “auto int a = 1;”
Line 2 is replaced by “register int a = 2;” (GATE CS 2012)
There are 50 questions to complete.