Answer to Question #331729 in C++ for Amy

Question #331729

Design a program that converts a decimal number into hexadecimal number without an array. Use a constructor.

1
Expert's answer
2022-04-21T07:02:55-0400



For example 16(10)=>10(16)

Testing this



//Code testing to replit online compiler
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
  //decimal to hex
  long numDecimal;//Number Decimal
  cout<<"Please enter number:";
  cin>>numDecimal;
  cout.setf(ios::hex|ios::uppercase);//Use UpperCase
  cout<<"To Hex:="<<hex<<numDecimal<<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