Input / Output - General Questions :: Discussion


12.What will be the output of the program?
A.k == 1 is TRUE
B.1 == 1 is TRUE
C.1 == 1 is FALSE
D.K == 1 is FALSE
Answer:  Option  B
Explanation:

Step 1int k=1; The variable k is declared as an integer type and initialized to '1'.

Step 2: printf("%d == 1 is" "%s\n", k, k==1?"TRUE":"FALSE"); becomes

=> k==1?"TRUE":"FALSE"

=> 1==1?"TRUE":"FALSE"

=> "TRUE"

Therefore the output of the program is 1 == 1 is TRUE

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