Classical

C Programming MCQ - I/O Operations

56:   Find the output of following code segment
for(putchar('c');putchar('a');putchar('r'))
putchar('t');
A. A syntax error
B. Cartrta
C. Catrat
D. Catratratratrat...
 
 

Option: D

Explanation :

putchar('t');'>
57:   Find output of following :
int i=5;
do{putchar(i+100);printf("%d",i--);}
while(i);
A. i5h4g3f2e1
B. 14h3g2f1e0
C. An error message
D. Infinite Loop
 
 

Option: A

Explanation :


58:  

The for statement can precede a loop to be executed 50 times or till a boolean variable "found" become false is given by

A.

for(i=0; i<=50 ll found==false; i++)

B.

for(i=0; i<50 ll found==true; i++)

C.

for(i=1;i<=50 && found==true; i++)

D.

Error

 
 

Option: A

Explanation :




Suggest an improvement