Ask your own question, for FREE!
Computer Science 13 Online
OpenStudy (anonymous):

In C++, I am asked to: 1. Ask the user to enter 2 integers. 2. Print both in decimal and hex. I know how to use cin, and cout, but not sure how to structure this small program.

OpenStudy (anonymous):

if my memory serves me correctly by using %x parameter in printf you get the hex of a decimal number

OpenStudy (anonymous):

Specify the format before the varaible... #include <iostream> using namespace std; int main () { int n; n=99; cout << hex << n << endl; cout << dec << n << endl; cout << oct << n << endl; return 0; }

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!