Write a program to print out the Ascii Code in a table
Write a program to print out your full name and the corresponding ASCII code of your full name
#include <iostream>
#include <string>
using namespace std;
int main() {
string fullName;
cout << "The ASCII characters:"<<endl ;
for (int i = 1; i <=255; i++)
{
cout << i<<" --> "<<char(i)<<endl;
}
cout << "Enter your full name: ";
getline(cin, fullName);
for(int i=0;i<fullName.length();i++){
cout << int(fullName[i])<<"\n";
}
system("pause");
return 0;
}
Comments
Leave a comment