C Language - Control Statements

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

 
13.

Which one of the following sentences is true?

A. he body of a while loop is executed at least once B. The body of a do...while loop is executed at least once
C. The body of a do...while loop is executed zero or more times D. A for loop can never be used in place of a while loop




14.

Which one of the following will set the value of y to 5 if x has the value 3, but not otherwise?

A. if (x = 3) y = 5; B. if x == 3 (y = 5);
C. if (x == 3); y = 5; D. if (x == 3) y = 5;




15.

#include

void main()
{
int num=20;
while(num>10)
{
printf("Hello");
printf(" shalu ");
}
}

A. Hello B. shalu
C. Hello shalu D. error




16.

#include

void main()
{
while('A')
printf("Hello");
}

A. A B. Hello
C. A Hello D. error




17.

#include

int main(){
while(){
printf("Hello shalu");
}
return 0;
}

A. Hello shalu B. 0
C. Compilation error D. 11




18.

#include

int main(){
int x=3,y=2;
while(x+y-1){
printf("%d ",x--+y);
}
return 0;
}

A. 5 5 4 4 B. 5 5 4 3
C. 5 4 4 3 D. 5 4 3 2




« previous

1

2

3

4

5

6

7

next »

 
 
 



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