3.main () { char a; int y; a=97; y=98; printf(“%c\n",x); printf(“%c\n",y); printf(“%c\n",a+2);}
Comment each C statement and write output
Explanation:
#include <stdio.h>
int main()
{
char a;//declaring character variable
int y;//declaring integer variable
a=97;//initialisng character variable with 97...
y=98;//initialising integer variable with 98
//printf("%c\n",x);//if we include this statement it is showing error because x is not declared anywhere in our program....
printf("%c\n",y);//here the ascii charatcter of 98 will be printed i.e., "b" because we have used %c i.e., character format specifier
printf("%c\n",a+2);//here the ascii character of a+2 i.e., 97+2=99 ,the ascii character of 99 is c
return 0;
}
Screenshots of the output:
Step by step
Solved in 3 steps with 2 images