Pejman Moghadam / C-programming

C++ - Simple cout usage

Public domain


#include <iostream>
using namespace std;
int main()
{
        cout << "Big number: " << 800000 << endl;
        cout << "Sum: " << 800000 + 900000 << endl;
        cout << "fraction: " << (float) 5/8 << endl;
        cout << "Very big number: " << (double) 800000 * 900000 << endl;
}

Output :

Big number: 800000
Sum: 1700000
fraction: 0.625
Very big number: 7.2e+11

BY: Pejman Moghadam
TAG: cpp, cout
DATE: 2011-05-28 08:59:21


Pejman Moghadam / C-programming [ TXT ]