Write a C Program to ASCII value of a Character:

Write a C Program to ASCII value of a Character:

C Program to ASCII value of a Character

#include <stdio.h>

int main() {
char ch;
printf("Enter the character");
scanf("%c",&ch);
printf("ASCII value of %c=%d",ch,ch); 
return 0;
}

Output:

Enter the character
O
ASCII value of O=79