Question: How do I modify this to print birth year in decamil, hexadecimal, and octal form. Label each value. Line up output in columns using the
How do I modify this to print birth year in decamil, hexadecimal, and octal form. Label each value. Line up output in columns using the tab character. And print your age using c++
#include using namespace std; //------------------------------------------------------------------------------ int main() { cout << 1234 << "\t(decimal) " << hex << 1234 << "\t(hexadecimal) " << oct << 1234 << "\t(octal) "; cout << 1234 << '\t' << hex << 1234 << '\t' << oct << 1234 << ' '; cout << 1234 << ' '; // the octal base is still in effect cout << 1234 << '\t' << hex << 1234 << '\t' << oct << 1234 << ' '; cout << showbase << dec; // show bases cout << 1234 << '\t' << hex << 1234 << '\t' << oct << 1234 << ' '; cout << 1234 << '\t' << 0x4d2 << '\t' << 02322 << ' '; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
