ExamVeda
Login
Home
This question belongs to C Program C Fundamentals
C Fundamentals
?

What will be the output of the following C code?
#include <stdio.h>
void main()
{
    int x = 97;
    char y = x;
    printf("%c\n", y);
}

Answer & Solution
Correct Answer: Option A
1. Declaration: int x = 97;

2. Conversion: char y = x;

3. ASCII Value: The ASCII value of 97 corresponds to the character 'a'.

4. Print: printf("%c\n", y); prints the character 'a'.
Examveda
Question posted by Examveda
Community

Join the Discussion

1 Comment
Sandhya Kadam
Sandhya Kadam 2 years ago
Value of the ASCII a is 97 so as per statement y=x and x=97 ,
here
x=97
y=x
97=a (ASCII table)