Q.What will be the output of the following? main ( ) { int a = 'A'; printf ("%d", a); }
Correct answer: 65
Explanation
The variable a is declared as an int and initialiazed with the value 'A'. In C, characters are represented by their ASCII values. The ASCII value for the character 'A' is 65. The output of the printf function will be 65.
The variable a is declared as an int and initialiazed with the value 'A'. In C, characters are represented by their ASCII values. The ASCII value for the character 'A' is 65. The output of the printf function will be 65.