Output integer with different base: 8, 10, 16
#include <iostream> #include <iomanip> using namespace std; int main(void) { cout << setbase(8) << 255 << '\n'; cout << setbase(10) << 255 << '\n'; cout << setbase(16) << 255 << '\n'; }