Key Features

Experienced Teachers
Smart Classes
Regular Test
Study Material

Well qualified teachers with industrial experience.

To visualise or understand topics very easly.

We are organizing online and offline regular test.

We are providing prescribed study material.

Friday, October 30, 2020

Question : Write a C Program to find ASCII value of a character entered by user.

Question :  Write a C Program to find ASCII value of a character entered by user.


#include <stdio.h>
int main()
{ 
            char c;
            printf("Enter a character: ");
            scanf("%c", &c); 
            // %d displays the integer value of a character
            // %c displays the actual character
            printf("ASCII value of %c = %d", c, c);
            return 0;
}

OUTPUT :
Enter a character: G
ASCII value of G = 71

Thank you very much for reading carefully, if you have any other questions, you can share it with us through comments, if this information was important to you, please let us know through comments.

Please do comment and share.
Thank You.

No comments:

Post a Comment