Declarations and Initializations - Find Output of Program :: Discussion


11.In the following program how long will the for loop get executed?
A.The for loop would not get executed at all
B.The for loop would get executed only once
C.The for loop would get executed 5 times
D.The for loop would get executed infinite times
Answer:  Option  D
Explanation:

During the for loop execution scanf() ask input and then printf() prints that given input. This process will be continued repeatedly because, scanf() returns the number of input given, the condition is always true(user gives a input means it reurns '1').

Hence this for loop would get executed infinite times.

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