Input / Output - Find Output of Program :: Discussion


7.What will be the output of the program?
A.Print the contents of file "myfile.c"
B.Infinite loop
C.Error in program
D.Print the contents of file "myfile.c" upto NULL character
Answer:  Option  B
Explanation:

The program will generate infinite loop. When an EOF is encountered fgetc() returns EOF. Instead of checking the condition for EOF we have checked it for NULL. so the program will generate infinite loop.

Tutorial Link:
Published by:Michael Daani

Comments are not available

Post your comments here:

Optional

Date to Date Current Affairs 2022

PakMCQs.net

Quick Links

GAT Subject



   Computer Science    English Mcqs    Agriculture    

Engineering



   Computer Science    Civil Engineering    

Technical



   Networking    Electronics    Database    

Past Papers



   Model Papers    FPSC Papers