Question : Write a C++ Program to Print ASCII Characters with Values.
Explain: C++ Question about Print ASCII Characters.
Example
A= 65
#include <iostream>
using namespace std;
int main()
{
char character;
int counter;
// for loop for counter 255 ASCII char
for(counter=1; counter<255; counter++)
{
// Display Number and value of ASCII code
character=counter;
cout<<counter<<"= "<<character<<"\t";
}
return 0;
}
Output:
Explain: C++ Question about Print ASCII Characters.
Example
A= 65
Solution:
/************************************************************
C++ Program for Print ASCII Chars Values
*************************************************************
***************** By www.cpplanguage.com *********************/
/************************************************************
C++ Program for Print ASCII Chars Values
*************************************************************
***************** By www.cpplanguage.com *********************/
#include <iostream>
using namespace std;
int main()
{
char character;
int counter;
// for loop for counter 255 ASCII char
for(counter=1; counter<255; counter++)
{
// Display Number and value of ASCII code
character=counter;
cout<<counter<<"= "<<character<<"\t";
}
return 0;
}
Output:
No comments:
Post a Comment