Decimal to hexadecimal converter helps you to calculate hexadecimal value from a decimal number value up to 10 characters length, and dec to hex conversion
#include <iostream> using namespace std; int main(void) { int mynum; cout << "\nEnter a number: "; cin >> mynum; cout.unsetf(ios::dec); cout.setf(ios::hex | ios::showbase); cout << "In hex: " << mynum; cout.unsetf(ios::hex); cout.setf(ios::oct); cout << "\nIn Octal: " << mynum; cout.unsetf(ios::oct | ios::showbase); cout.setf(ios::dec); system("pause"); return 0; }
Note: This post is for education purpose. Just take help from this code. Please show your own project to your Teacher/Professor. You can make better than it. Try Your self. Give a chance to your intelligence. Thank you