60 721
Assignments Done
97,9%
Successfully Done
In April 2018

Answer to Question #19366 in C++ for shamroz

Question #19366
write a program that display the ascii code of the enter char.
Expert's answer
#include <iostream>
using namespace std;
int main()
{
unsigned char ucCharacter;
cin >> ucCharacter;
cout << hex << "0x" << (unsigned int)ucCharacter <<endl;
int iChNum;
cin >> hex >> iChNum;
cout << (unsigned char)iChNum <<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 first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions