Multiple choice technology programming languages

What will be the output of following code segment? #include #include void main() {     char c=-'a';     printf("%d",c); }

  1. 65

  2. -65

  3. 97

  4. -97

  5. CompilationError

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

The expression -'a' applies unary minus to the character 'a' (ASCII value 97), giving -97. This value is stored in char c and printed with %d format specifier as an integer, resulting in -97.