Answer to Question #82342 in C++ for Resham

Question #82342
Display ascii value until user will not strike enter key
1
Expert's answer
2018-10-24T13:50:09-0400

#include <iostream>

using namespace std;


int main() {

while (true) {

cout << "Enter a character: ";

string s;

getline(cin,s);

if (s == "") break;

cout << " ASCII value: " << (int)s[0] << endl;

}

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
APPROVED BY CLIENTS