Program : -
#include<stdio.h>
#include<conio.h>
void main()
{
char c;
printf("Enter a character :");
scanf("%c",&c);
printf("ASCII value of %c is %d",c,c);
getch();
}
Output : -
Enter a character :G
ASCII value of G is 71
#include<stdio.h>
#include<conio.h>
void main()
{
char c;
printf("Enter a character :");
scanf("%c",&c);
printf("ASCII value of %c is %d",c,c);
getch();
}
Output : -
Enter a character :G
ASCII value of G is 71