Lowest price ever! Learn Generative AI for 48% less!
Get my discount+ 1
#include <iostream>
# include <iomanip>
using namespace std;
int main() {
int num;
cin>>num;
cout<<"your number: "<<num<<endl;
cout<<"hex = "<<hex<<num<<endl;
cout<<"oct = "<<oct<<num<<endl;
return 0;
}
/*
use these headers:
#include <iostream>
# include <iomanip>
using namespace std;
then, in a cout statement, write hex or oct,
the next number after that will be written in hex or oct.
example
cout<<oct<<9; (writes 11, octal for nine)
int test = 15;
cout<<hex<<test; (writes f, hexa for 15)
*/