Question 61
What will be printed by 'printf("%d", 10 == 10);'?
Detailed Solution
In C, equality operator == returns integer 1 for true condition.
✓ Saved
What will be printed by 'printf("%d", 10 == 10);'?
In C, equality operator == returns integer 1 for true condition.
What is the value of 'x' after loop termination: 'for (x = 0; x < 10; x += 3);'?
x values in iterations: 0, 3, 6, 9. Next increment makes x = 12, failing condition x < 10.
What is printed by this code?
#include <stdio.h>
int main(void) {
int x = 5;
if (x = 0)
printf("True");
else
printf("False");
return 0;
}x = 0 is an assignment yielding 0 (false). The else branch executes, printing 'False'.
What is the output of 'printf("%d", !5);' in C?
Logical NOT operator ! inverts non-zero truth value 5 to 0.
What is the return type of the 'sizeof' operator in C?
The sizeof operator evaluates to an unsigned integer type size_t.