C Program Find ASCII Value of a Character

C Program to Find ASCII Value of a Character

ASCII is the most important part of the computer. Computer works on ASCII code. The computer does not understand the character of the keyboard, but works on the ASCII code. Each character has a different ASCII code. Computer has 256 main ASCII codes.

Here we will print the ASCII values ​​of the characters stored in the computer in the C program

#include<stdio.h>
#include<conio.h>
void main() 
{
    char ch;
  
  printf("\n Please Enter any character \n");
  scanf("%c",&ch);
  
  printf("\n The ASCII value of given character = %d",ch);
 
   getch();
}
 

Output

  1. You can see here. First of all the Header File Structure of the C Program has been created.
  2. After that Main() Function is written.
  3. int num1,num2 These variables have been created. In which the data is stored
  4. add is also a variable created. Whose value is num1+num2.
  5. printf(“addition = %d”,add); Here the value of add has been printed.
TOP