What Is ASCII Code In C Language?
ASCII stands for the American Standard Code for information interchange. It is a character encoding system used for electronics communication devices. In Electronics communication devices each characters represented by number from 0 to 127 that is stored as binary format (bits) in memory. ASCII use 7 bits for store a char value. A character variable does not contain character, it contain numbers from 0 to 127. when we assign a character in a variable it store its ASCII code. we can print character as number using %d format specifier. For example, if we print 'A' with %d
output will be 65.
In This Examples we are printing A to Z using ASCII code.
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char const *argv[])
{
char x = 65; // char x = 'A' ASCII value of 'A'
for (x; x < 65 + 26; x++)
{
printf(" %c", x);
}
return 0;
}
Here is the list of some ascii code and their corresponding characters:
The ASCII code of '!' is 33
The ASCII code of '"' is 34
The ASCII code of '#' is 35
The ASCII code of '$' is 36
The ASCII code of '%' is 37
The ASCII code of '&' is 38
The ASCII code of ''' is 39
The ASCII code of '(' is 40
The ASCII code of ')' is 41
The ASCII code of '*' is 42
The ASCII code of '+' is 43
The ASCII code of ',' is 44
The ASCII code of '-' is 45
The ASCII code of '.' is 46
The ASCII code of '/' is 47
The ASCII code of '0' is 48
The ASCII code of '1' is 49
The ASCII code of '2' is 50
The ASCII code of '3' is 51
The ASCII code of '4' is 52
The ASCII code of '5' is 53
The ASCII code of '6' is 54
The ASCII code of '7' is 55
The ASCII code of '8' is 56
The ASCII code of '9' is 57
The ASCII code of ':' is 58
The ASCII code of ';' is 59
The ASCII code of '<' is 60
The ASCII code of '=' is 61
The ASCII code of '>' is 62
The ASCII code of '?' is 63
The ASCII code of '@' is 64
The ASCII code of 'A' is 65
The ASCII code of 'B' is 66
The ASCII code of 'C' is 67
The ASCII code of 'D' is 68
The ASCII code of 'E' is 69
The ASCII code of 'F' is 70
The ASCII code of 'G' is 71
The ASCII code of 'H' is 72
The ASCII code of 'I' is 73
The ASCII code of 'J' is 74
The ASCII code of 'K' is 75
The ASCII code of 'L' is 76
The ASCII code of 'M' is 77
The ASCII code of 'N' is 78
The ASCII code of 'O' is 79
The ASCII code of 'P' is 80
The ASCII code of 'Q' is 81
The ASCII code of 'R' is 82
The ASCII code of 'S' is 83
The ASCII code of 'T' is 84
The ASCII code of 'U' is 85
The ASCII code of 'V' is 86
The ASCII code of 'W' is 87
The ASCII code of 'X' is 88
The ASCII code of 'Y' is 89
The ASCII code of 'Z' is 90
The ASCII code of '[' is 91
The ASCII code of '\' is 92
The ASCII code of ']' is 93
The ASCII code of '^' is 94
The ASCII code of '_' is 95
The ASCII code of '`' is 96
The ASCII code of 'a' is 97
The ASCII code of 'b' is 98
The ASCII code of 'c' is 99
The ASCII code of 'd' is 100
The ASCII code of 'e' is 101
The ASCII code of 'f' is 102
The ASCII code of 'g' is 103
The ASCII code of 'h' is 104
The ASCII code of 'i' is 105
The ASCII code of 'j' is 106
The ASCII code of 'k' is 107
The ASCII code of 'l' is 108
The ASCII code of 'm' is 109
The ASCII code of 'n' is 110
The ASCII code of 'o' is 111
The ASCII code of 'p' is 112
The ASCII code of 'q' is 113
The ASCII code of 'r' is 114
The ASCII code of 's' is 115
The ASCII code of 't' is 116
The ASCII code of 'u' is 117
The ASCII code of 'v' is 118
The ASCII code of 'w' is 119
The ASCII code of 'x' is 120
The ASCII code of 'y' is 121
The ASCII code of 'z' is 122
The ASCII code of '{' is 123
The ASCII code of '|' is 124
The ASCII code of '}' is 125
The ASCII code of '~' is 126