Input / Output - Find Output of Program :: Discussion


5.What will be the output of the program?
A.This is PakMcqs
B.This is
C.Infinite loop
D.Error
Answer:  Option  C
Explanation:

The macro EOF means -1.

while((ch=getc(fp)) != EOF) Here getc function read the character and convert it to an integer value and store it in the variable ch, but it is declared as an unsigned char. So the while loop runs infinitely.

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