C Tutorial
This c program uses the '%d' in print statement that returns the corresponding ASCII value for a input character.
#include<stdio.h> void main() { char ch; printf("Character to find ASCII: "); // Reads a character from the user inputs scanf("%c", &ch); // displays the character and corresponding ASCII value printf("ASCII value of %c = %d\n", ch, ch); }Output:
$ cc ascii.c $ ./a.out Character to find ASCII: a ASCII value of a = 97 $ ./a.out Character to find ASCII: A ASCII value of A = 65
C Tutorial
Privacy Policy | Copyright2020 - All Rights Reserved. | Contact us
| Report website issues in Github
| Facebook page
| Google+ page