C Language - Storage Classes

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

 
49.

extern int i; //Declaring the variable i.

int i=25; //Initializing the variable.
extern int i; //Again declaring the variable i.
#include
int main(){
extern int i; //Again declaring the variable i.
printf("%d",i);
return 0;
}

A. 0 B. 2
C. 25 D. error




50.

#include

extern int i;
int i=10; //Initialization statement
i=25; //Assignment statement
int main(){
printf("%d",i);
return 0;
}

A. 10 B. 25
C. 0 D. Compilation error




51.

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)

A. 3 1
4 1
4 2
B. 4 2
6 1
6 1
C. 4 2
6 2
2 0
D. 4 2
4 2
2 0




52.

What will be the output of the following code ?

static int i = ;
main ( )
{
int sum=;
do
{
sum+=(/i);
}while (
printf ("sum of the series is %d", sum );
}

A. It will print the sum of the series 1/5+1/4+.....+1/1. B. It will produce a compilation error.
C. It will produce a runtime error. D. None of the above.




53.

include

int main()
{
auto int i=1;
{
auto int i=2;
{
auto int i=3;
printf("\n%d",i);
}
printf("\n%d",i);
}
printf("\n%d",i);
return 0;
}

A. 1
2
3
B. 3
2
1
C. 1
1
1
D. 3
3
3




54.

#include

int main()
{
register int i;
for(i=10; i>=0; i=i-2)
printf("%d ",i);
return 0;
}

A. 10 8 8 8 8 8 B. 10 8 4 2 0 0
C. 10 8 6 4 2 0 D. 10 0 0 0 0 0




« previous

1

2

3

4

5

6

8

9

...

next »

 
 
 



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