C Language - Storage Classes

You Are Here :: Home > C Language > Storage Classes- General Questions

 
55.

#include

void add();
int main()
{
add();
add();
add();
add();
return 0;
}
void add()
{
static int i=1;
printf("\n%d",i);
i=i+1;
}

A. 1
2
3
4
B. 1
1
2
3
C. 1
3
5
7
D. Compile time error




56.

27 Which part of the program address space is p stored in the code given below?

#include
int *p = NULL;
int main()
{
int i = 0;
p = &i;
return 0;
}

A. Code/text segment B. Data segment
C. Bss segment D. Stack




57.

What is the output of this C code?

#include
void main()
{
register int x = 0;
if (x < 2)
{
x++;
main();
}
}

A. Segmentation fault B. main is called twice
C. main is called once D. main is called thrice




58.

What is the output of this C code?

#include
void main()
{
int x;
}
here x is

A. automatic variable B. static variable
C. register variable D. global variable




« previous

10

 
 
 



© 2013 freshersindia.in ® | Copyrights | Terms & Conditions
   Designed by Freshers India
Catch Us on