C Language - Control Statements

You Are Here :: Home > C Language > Control Statements - General Questions

 
37.

#include

void main(){
int a=5,b=10,c=1;
if(a&&b>c){
printf("shalu");
}
else{
break;
}
}
Choose all that apply:

A. shalu B. It will print nothing
C. Run time error D. Compilation error




38.

What will be output when you will execute following c code?

#include
void main(){
int m=5,n=10,q=20;
if(q/n*m)
printf("shalini");
else
printf(" shalu");
printf(" deepu");
}
Choose all that apply:

A. shalini B. shalu deepu
C. Run time error D. None of the above




39.

What will be output when you will execute following c code?

#include
void main(){
if(!printf("shalu"))
if(printf(" deepu"));
}
Choose all that apply:

A. shalu B. deepu
C. shalu deepu D. Compilation error: if statement without body




40.

What will be output when you will execute following c code?

#include
void main(){
int a=5,b=10;
if(++a||++b)
printf("%d %d",a,b);
else
printf("shalini");
}
Choose all that apply:

A. 5 10 B. shalini
C. 6 10 D. error




41.

#include

void main(){
char c=256;
char *ptr="Leon";
if(c==0)
while(!c)
if(*ptr++)
printf("%+u",c);
else
break;
}
Choose all that apply:

A. +256+256+256+256 B. 0000
C. +0+0+0+0 D. Compilation error




42.

What will be the output of the following program ?

#include
void main()
{
int a = 2;
switch(a)
{
case 1:
printf("goodbye"); break;
case 2:
continue;
case 3:
printf("bye");
}
}

A. goodbye B. bye
C. byegoodbye D. error




« previous

1

2

3

4

5

6

7

 
 
 



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