Answer to Question #19366 in C++ for shamroz

Question #19366
write a program that display the ascii code of the enter char.
1
Expert's answer
2012-11-26T05:58:27-0500
#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 the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS