The nastiest C output questions are often decided before the visible operator runs. The compiler promotes a small integer, converts a signed operand to unsigned, or chooses integer division, and the result no longer matches the expression you thought you read.
Make those silent conversions explicit. For every expression, determine the operand types first, apply the required conversions, and only then evaluate the operator.
The usual arithmetic conversions run first
Types narrower than int, including most char and short types, undergo integer promotion in arithmetic and comparison expressions. If int can represent every value of the original type, the value becomes int; otherwise it becomes unsigned int.
After promotion, a binary operator generally needs both operands in a common type. The usual arithmetic conversions choose that type. The common GATE trap uses int with unsigned int: both have the same rank, so the signed int operand is converted to unsigned int.
For types with different ranks, the exact rule considers both rank and range. If the signed type can represent every value of the unsigned type, both convert to the signed type. Otherwise the calculation uses an appropriate unsigned type. This is why the shortcut "unsigned always wins" is useful for equal-rank int questions but not a complete statement of C.
Use this order on paper:
Identify each operand's original type.
Apply integer promotions to
charandshortoperands.Find the common type required by the usual arithmetic conversions.
Convert the values to that type.
Apply the operator.
Worked signed and unsigned comparison
Consider this program, assuming 32-bit int and unsigned int:
int a = -1;
unsigned int b = 1;
if (a > b)
printf("a > b");
else
printf("a <= b");The comparison has operands of equal rank, one signed and one unsigned. C converts a to unsigned int. Conversion to a 32-bit unsigned type is modulo 2^32:
-1 mod 2^32 = 2^32 - 1 = 4294967295
On a conventional 32-bit two's-complement machine, the bit pattern is all ones:
0xFFFFFFFF
The comparison actually evaluated is therefore:
4294967295 > 1
That is true, so the program prints a > b. The source looks like a comparison between negative one and positive one, but the operator receives two unsigned values. The binary representation behind the result is easier to see after revising Number Systems and Base Conversions.

The value 4294967295 depends on the stated 32-bit width. The conversion rule is portable, but a question using another unsigned width would produce that type's maximum value instead.
Worked char conversion and promotion
Now consider:
char c = 200;
printf("%d\n", c);This does not have one portable numeric output. Plain char may be signed or unsigned, and converting 200 to a signed 8-bit char is implementation-defined because 200 is outside its range.
Suppose the question explicitly gives an implementation where plain char is signed, eight bits wide, and an out-of-range conversion retains the low eight bits. The stored pattern for 200 is:
11001000
As an 8-bit two's-complement signed value, it equals:
200 - 256 = -56
When passed to printf, c is promoted to int, preserving the value -56, so %d prints -56. The assumption is part of the answer. Without it, claiming that every C implementation prints -56 is wrong.
Compare that with an unsigned case:
unsigned char x = 255;
x = x + 1;
printf("%d\n", x);On the usual system where int can represent 0 through 255, x first promotes to int. The addition produces integer 256. Assignment back to 8-bit unsigned char reduces the value modulo 256:
256 mod 256 = 0
The later argument promotion sends integer 0 to printf, so the program prints 0. Strictly speaking, this example wraps during conversion back to unsigned char, not during the addition itself.
Sizeof, division, and quiet type changes
In C, a character constant such as 'A' has type int, not char. Therefore:
sizeof('A') == sizeof(int)
On an implementation where sizeof(int) is 4, sizeof('A') is 4. By definition, sizeof(char) is 1 byte. Do not transfer the C++ rule for character literals into a C question.
Integer division discards the fractional part and truncates toward zero:
5 / 2evaluates to2.-5 / 2evaluates to-2.3 * (1 / 2)evaluates to3 * 0, which is0.
The multiplication cannot recover a fraction that integer division has already discarded. In 1.0 / 2, however, the first operand is double, so the second converts to double and the result is 0.5.
sizeof introduces another kind of quiet behaviour: its operand is normally not evaluated. If i is an ordinary variable, sizeof(i++) reports the size of i's type without incrementing i. Variable length arrays are the important exception because their size may be evaluated at run time.
Overflow and conversion traps
Unsigned integer arithmetic is defined modulo one more than the type's maximum value. For a 32-bit unsigned int, UINT_MAX + 1U becomes 0. That behaviour is guaranteed for unsigned arithmetic.
Signed arithmetic overflow is different. Evaluating INT_MAX + 1 in signed int invokes undefined behaviour. The C language does not promise a wrap to INT_MIN, even if the machine uses two's complement. Also keep it distinct from an out-of-range conversion to a signed integer type, which is implementation-defined rather than the same signed-overflow rule.
The high-value traps are:
A negative
intcan become a largeunsigned intbefore comparison.Plain
charsignedness is implementation-defined.A C character constant has type
int.Integer division happens before later floating-point context can help.
Signed overflow is undefined, while unsigned arithmetic is modular.
The worked sets in C Programming Interview Questions for Freshers help turn these rules into quick output predictions.
How GATE tests data types and operators
Expect a short program that mixes signed and unsigned operands, stores a value in char or short, asks for sizeof results, or combines integer and floating-point division. Another common shape asks which line has undefined behaviour.
Do not start by simulating the source values mentally. Write the common type beside every mixed expression. Convert both values, perform integer division or arithmetic in that type, and only then follow assignment conversion. If the result depends on char signedness, integer width, or another implementation choice, say so unless the question states the choice.
For the exact Programming and Data Structures scope, confirm the syllabus wording on the official GATE portal of the organising IIT.
The short version and next step
Conversions run before operators. Small integer types promote, equal-rank signed int and unsigned int combine as unsigned, signed overflow is undefined, and unsigned arithmetic wraps modulo a power of two.
Build the full sequence with the C Programming course, then use the Coding Skills category to connect these output traps to pointers, arrays, and functions. The question bank has about 900 published C-programming questions, including implicit conversion, sizeof, and unsigned comparison.




