How to get the ASCII value of a character in c
#include<stdio.h>
int main(){
char c;
char c;
printf("Enter any character: ");
scanf("%c",&c);
scanf("%c",&c);
printf("ASCII value of given character: %d",c);
return 0;
}
return 0;
}
Sample output:
Enter any character: a
ASCII value of given character: 97
Enter any character: a
ASCII value of given character: 97
No comments:
Post a Comment