10-Write a C program to find the ASCII value of a character.

Program: 10

Write a C program to find the ASCII value of a character.

#include
#include
void main()
{
    char name;
   int x;
    printf("Enter any character: ");
    scanf("%c", &name);
    x=name;
   printf("The ASCII value of %c is: %d", name, x);
    getch();
}
Output
Enter any character: s
The ASCII value of s is: 115

The value of b is: 43

Lokesh Kumar: Being EASTER SCIENCE's founder, Lokesh Kumar wants to share his knowledge and ideas. His motive is "We assist you to choose the best", He believes in different thinking.
Related Post
Leave a Comment

This website uses cookies.