Creating a Loading Bar in C++
Creating Searching Progress Bar in C++
Creating Printing Progress Bar in C++
Creating Downloading Progress Bar in C++
Creating a Timer using in C++
Sorting Array Elements as Ascending and Descending Order in C++
Searching Element in Array List in C++
Class with Multidimensional Array in C++
Convert digit values into Character in C++
ASCII– American Standard Code for Information Interchange
इस page में हम सभी ASCII codes अर्थात यानी वर्णमाला वर्ण (Alphabet characters (uppercase and lowercase), Numeric Value, और कुछ Special Character के ascii value को प्रिंट करेंगे।
ASCII values के साथ, उनके मूल values को भी program में print किया गया है ताकि readability प्राप्त की जा सके और कार्यक्रम को आसानी से समझा जा सके।
किसी value का ASCII codes ज्ञात करने के लिए ,
char = 'a';
Now, to print the ASCII code of this a
int (a); // 97 will be print
Before starting the program, see the output of the program, so that you can easily understood.
इसका program निचे दिया गया है –
Printing all ASCII values in C++
#include<iostream.h>
#include<conio.h>
#include<dos.h>
void prntline(); // print line ____
void prntln(); // print line ====
void main()
{
clrscr();
char c='A',s='a';
cout<<endl;
cout<<"ASCII code(for capital latter): \n";
prntln(); // print line
cout<<"\n\n";
/********FOR CAPITAL LATTER*******/
int i =0;
while(i<26) // because alphabet has 26
{
cout<<c<<"-"; // print variable c value
// printing char variable using int data type
cout<<int(c++)<<" ";
i++;
}
cout<<endl;
prntline();
getch();
/********FOR SMALL LATTER*******/
cout<<"\n\nASCII code(for small latter):\n";
prntln();
cout<<"\n\n";
int j =0;
while(j<26)
{
cout<<s<<"-"; // print variable s value
cout<<int(s++)<<" ";
j++;
}
cout<<endl;
prntline(); // print a line
getch();
/********FOR NUMERIC VALUE*******/
cout<<"\n\nASCII code(for numeric values): \n";
prntln(); // print line
cout<<"\n\n";
for(int k=48;k<=57;k++)
{
cout<<k<<"-"; // print k value
//print int variable value using char data type
cout<<char(k)<<" "; // printing ascii code
}
cout<<endl;
prntline(); // print a line
getch();
/*****FOR SPECIAL CHARECTER*****/
cout<<"\n\nASCII code(for special chahrecter):\n";
prntline(); // print line
cout<<"\n\n";
for(int x=32;x<48;x++)
{
cout<<x<<"-"; // print original value
cout<<char(x)<<" "; // print ascii value
}
cout<<endl;
prntline(); // print line
getch();
} // close void main() function
void prntline()
{
// line ___ definition
int l=0;
while(l<80)
{
cout<<"_";
l++;
}
}
void prntln()
{
// line ==== definition
int n=0;
while(n<35)
{
cout<<"=";n++;
}
}
OUTPUT
ASCII code(for capital latter):
===================================
A-65 B-66 C-67 D-68 E-69 F-70 G-71 H-72 I-73 J-74 K-75 L-76 M-77 N
-78 O-79 P-80 Q-81 R-82 S-83 T-84 U-85 V-86 W-87 X-88 Y-89 Z-90
________________________________________________________________
ASCII code(for small latter):
===================================
a-97 b-98 c-99 d-100 e-101 f-102 g-103 h-104 i-105 j-106 k-107 l-108
m-109 n-110 o-111 p-112 q-113 r-114 s-115 t-116 u-117 v-118 w-119 x-
120 y-121 z-122
________________________________________________________________
ASCII code(for numeric values):
===================================
48-0 49-1 50-2 51-3 52-4 53-5 54-6 55-7 56-8 57-9
________________________________________________________________
ASCII code(for special charecter):
===================================
32-space 33-! 34-" 35-# 36-$ 37-% 38-& 39-' 40-( 41-) 42-* 43-+ 44-, 45-- 46-. 47-/
________________________________________________________________
इसका एक अन्य program character array में दिया गया है –