Answer to Question #295584 in C++ for Tobi

Question #295584

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

1
Expert's answer
2022-02-09T09:25:05-0500
#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;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog