Print ASCII of a Character Using Integer Variable
#include <stdio.h>
#include <conio.h>
//Program to Print ASCII of a Character - FScOnline.info
void main()
{
int x;
char ch;
printf("Enter Character: ");
scanf("%c", &ch);
x=ch;
printf("ASCII Value of %c: %d",ch,x);
getch();
}
Print ASCII of a Character Without Using Integer Variable
#include <conio.h>
//Program to Print ASCII of a Character - FScOnline.info
void main()
{
char ch;
printf("Enter Character: ");
scanf("%c", &ch);
printf("ASCII Value of %c: %d",ch,ch);
getch();
}
Output
