Answer to Question #276813 in C++ for Roe

Question #276813

Write c++ code that



(1) Please enter any character from the keyboard.


(2) Please let the computer output two lines: the first line is in the form of characters, 3 characters are output, the 3 characters are separated by commas, and the second line is the ASCII code corresponding to the output characters.


(3)run test the code in main

1
Expert's answer
2021-12-07T21:35:58-0500
#include <iostream>

using namespace std;

int main() {
  char c; cin >> c;
  cout << c << " - " << (int) c << 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