/*A
simple C++ program to display ASCII values of English
Alphabets. You can extend this program to show all ASCII values and
their corresponding characters by modifying for loop
for(i=0;i<=255;i++) & removing if and continue statements from line
no 9 and 10 respectively.*/
#include<stdio.h>
#include<conio.h> //For console input/output function
void main()
{
int i;
for(i=65;i<=122;i++) //ASCII value of alphabets ranges from 65 to 122 {
if (i >=91 && i <= 96) //to avoid non alpha characters
continue;
printf("%d - %c", i, i);
printf("\t");
}
getche();
}
void main()
{
int i;
for(i=65;i<=122;i++) //ASCII value of alphabets ranges from 65 to 122 {
if (i >=91 && i <= 96) //to avoid non alpha characters
continue;
printf("%d - %c", i, i);
printf("\t");
}
getche();
}
0 comments:
Post a Comment