Input / Output – Find Output of Program

1. What will be the content of ‘file.c’ after executing the following program?

Screenshot 1

Screenshot 14

Correct Answer: Option A

2. What will be the output of the program ?

Screenshot 2

A. k == 1 is TRUE
B. 1 == 1 is TRUE
C. 1 == 1 is FALSE
D. K == 1 is FALSE

Correct Answer: Option B

3. What will be the output of the program ?

Screenshot 3

A. char *str = “char *str = %c%s%c; main(){ printf(str, 34, str, 34);}”; main(){ printf(str, 34, str, 34);}
B. char *str = %c%s%c; main(){ printf(str, 34, str, 34);}
C. No output
D. Error in program

Correct Answer: A. char *str = “char *str = %c%s%c; main(){ printf(str, 34, str, 34);}”; main(){ printf(str, 34, str, 34);}

4. If the file ‘source.txt’ contains a line “Be my friend” which of the following will be the output of below program?

Screenshot 4

A. friend
B. frien
C. end
D. Error in fseek();

Correct Answer: C. end

5. What will be the output of the program ?

Screenshot 5

A. 3.00
B. 3.15
C. 3.2
D. 3

Correct Answer: C. 3.2

Leave A Comment?

four × 1 =