- What is two’s complement representation?
- How does representation of integers and floating-point values differ in C?
- What is type narrowing?
- What is type promotion?
- What is type casting?
-
What is the output of the code segment below?
int n = 32065; float x = 24.79; printf("int n = %d but (char) n = %c\n", n, (char) n); printf("float x = %f but (long) x = %ld\n", x, (long) x);
- Given the variables above, write an expression to store the value of half of
n
plus ten timesx
truncated to a whole number into variablelong result;
. You can only use the literal values2
and10
in your solution.