C programming
int main()
{
char c;
printf("Enter a character: ");
scanf("%c", &c);
// %d :- display integer value of a character
// %c :- display actual character
printf("ASCII value of %c = %d\n", c, c);
return 0;
}
Try it Yourself ➠
Find ASCII Value of Character in C
22 May
0
Write a program (WAP) in C to read two numbers from keyboard(User Input) to find ASCII value of a character.
#include <stdio.h>int main()
{
char c;
printf("Enter a character: ");
scanf("%c", &c);
// %d :- display integer value of a character
// %c :- display actual character
printf("ASCII value of %c = %d\n", c, c);
return 0;
}
Try it Yourself ➠
Must Read :-
Previous article
Next article
Leave Comments
Post a Comment