What is printed by this C code: unsigned char c = 255; c = c + 1; printf(“%d”, c);?
Correct answer C. 0
Subject / 929 questions
Page 5 of Programming multiple-choice questions with answers. Tap an option to check yourself.
Page 5 of 47
Correct answer C. 0
Correct answer A. <stdint.h>
Correct answer C. int
Correct answer B. -3
Correct answer A. 4
Correct answer D. ?: (conditional operator)
Correct answer A. 1 2
Correct answer D. The comma operator
Correct answer D. -3 -1
Correct answer B. Assignment associates right to left, so c = 4 is evaluated first and its value is assigned onward
Correct answer D. Because the full definition must be visible wherever the template is instantiated
Correct answer C. BD~D~B
Correct answer D. 234
Correct answer C. It forces every file that includes the header to import all std names, risking name clashes
Correct answer A. 6 7
Correct answer B. It returns a null pointer
Correct answer B. Because the left operand is the ostream, not an object of the user's class
Correct answer C. 7 2.5
Correct answer C. 19
Correct answer D. It casts it to an rvalue reference so move operations can be selected