The following code will get the ASCII code of the character entered by the user
#include<stdio.h>
int main()
{
int x;
char character;
printf("ENTER THE CHARACTER\n");
scanf("%c",&character);
x=character;
printf("THE ASCII VALUE OF %c is %d\n",character,x);
return 0;
}
No comments:
Post a Comment