C++ examples for File Stream:cin
Read a decimal number, Converts decimal to octal and hex
#include <iostream> using namespace std; int main() {//from w ww . j a va2s . c o m int number; cout << "Enter a decimal number: "; cin >> number; cout << "value in octal = 0" << oct << number << endl; cout << "value in hex = 0x" << hex << number << endl; }