Output of C++ programs | Set 45
Q.1 What Is The Output Of this program?
a) 50 50 50
b) Three Gaebage Value
c) 10 10 10
d) Compile Time Error
Explanation : In this program, b and c are not declared and we can not directly assign the value to them so “Compilation Time” error occurred.
Q.2 What Is The Output Of this program?
a) hx = a
b) hx = 12
c) hx = c
d) hx= 13
Explanation : In this code a double value modulus an integer value is given and further the result is left shifted 2 bits and printed in hexa-decimal form.
Q.3 What Is The Output Of this program?
a) 144, 32
b) 32, 144
c) 100, 12
d) 12, 144
Explanation : In this program, #define macro used to replace value and calculated them like this:
10 + 2 * 10 + 2 = 32 or (10+2)*(10+2) = 144
Q.4 What Is The Output Of this program?
a) p= 101
b) p= 107
c) p= 40
Explanation : In this program 0x is hexa-decimal notation and 0 is octal, convert these value in decimal and add them.
Q.5 What Is The Output Of this program?
d) None of these
Explanation : In this program, *a is hard core string that contain a base address of string. When we increment the address, it points to next value of the string.
This article is contributed by Gyayak jain . If you like GeeksforGeeks and would like to contribute, you can also write an article using write.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.