Const - Find Output of Program :: Discussion


7.What will be the output of the program?
A.20
B.0
C.Garbage Value
D.Error
Answer:  Option  A
Explanation:

Step 1int get(); This is the function prototype for the funtion get(), it tells the compiler returns an integer value and accept no parameters.

Step 2const int x = get(); The constant variable x is declared as an integer data type and initialized with the value "20".

The function get() returns the value "20".

Step 3printf("%d", x); It prints the value of the variable x.

Hence the output of the program is "20".

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