C and C PLUS PLUS PROGRAMMING
Thursday, March 30, 2017
C plus plus Program to print the ASCII values of all the alphabets
The following program will print the ASCII codes for all the alphabets in lower as well as in upper case
#include
using namespace std; int main(){ char chLow='a',chUpper='A'; cout << "Printing the ascii values of all alphabets\n" ; for(int i=0;i<=25;i++) cout << "ASCII vlaue of " << chLow++ << " is = "<< static_cast
(chLow) << " and "<< chUpper++<<" is = "<< static_cast
(chUpper)<< "\n"; return 0; }
Save, compile and execute
g++ print_ascii.cpp -o print_ascii ./print_ascii ASCII vlaue of a is = 97 and A is = 65 ASCII vlaue of b is = 98 and B is = 66 ASCII vlaue of c is = 99 and C is = 67 ASCII vlaue of d is = 100 and D is = 68 ASCII vlaue of e is = 101 and E is = 69 ASCII vlaue of f is = 102 and F is = 70 ASCII vlaue of g is = 103 and G is = 71 ASCII vlaue of h is = 104 and H is = 72 ASCII vlaue of i is = 105 and I is = 73 ASCII vlaue of j is = 106 and J is = 74 ASCII vlaue of k is = 107 and K is = 75 ASCII vlaue of l is = 108 and L is = 76 ASCII vlaue of m is = 109 and M is = 77 ASCII vlaue of n is = 110 and N is = 78 ASCII vlaue of o is = 111 and O is = 79 ASCII vlaue of p is = 112 and P is = 80 ASCII vlaue of q is = 113 and Q is = 81 ASCII vlaue of r is = 114 and R is = 82 ASCII vlaue of s is = 115 and S is = 83 ASCII vlaue of t is = 116 and T is = 84 ASCII vlaue of u is = 117 and U is = 85 ASCII vlaue of v is = 118 and V is = 86 ASCII vlaue of w is = 119 and W is = 87 ASCII vlaue of x is = 120 and X is = 88 ASCII vlaue of y is = 121 and Y is = 89 ASCII vlaue of z is = 122 and Z is = 90
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment