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.ASCII Table |
Important Tools:
1. char variableYou can also see:
1. Design a Latin square in C-Programming2. Design * triangle in C-Programming
Code:
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:
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.
Hey I have read your article it is nice. Please do read my article.
ReplyDelete