09/03/2019

Find ASCII value in C-Programming

Find ASCII value in C-Programming:

What is ASCII value? ASCII stands for American Standard Code for Information Interchange. Below is the ASCII character table, including descriptions of the first 32 characters. ASCII was originally designed for use with teletypes, and so the descriptions are somewhat obscure and their use is frequently not as intended. Moreover Java actually uses Unicode, which includes ASCII and other characters from languages around the world. For Example ASCII value of A=65, B=66.
Find ASCII value in C-Programming
ASCII Table


Important Tools:

1. char variable

You can also see:

1. 
2. 

Code:

Find ASCII value in C-Programming
CODE

#include<stdio.h>
int main()
{
  char n;
  printf("Enter the character of which you want to find ASCII number:");
  scanf("%c",&n);
  printf("The ASCII value is %d",n);
}


Output:

Find ASCII value in C-Programming
Output

Explanation:

1. We use Header Package <stdio.h> here.
2. Then we use char variable n. To know about char variable visit Syntax page.
3. Then we store the char value in the variable n and we print it in next line. You have to put any character and it will give you the corresponding ASCII value.

You Can See Also:



1 comment: