home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Beginning C++ Through Gam…rogramming (2nd Edition)
/
BCGP2E.ISO
/
source
/
chapter01
/
expensive_calculator.cpp
next >
Wrap
C/C++ Source or Header
|
2003-09-16
|
497b
|
23 lines
// Expensive Calculator
// Demonstrates built-in arithmetic operators
#include <iostream>
using namespace std;
int main()
{
cout << "7 + 3 = " << 7 + 3 << endl;
cout << "7 - 3 = " << 7 - 3 << endl;
cout << "7 * 3 = " << 7 * 3 << endl;
cout << "7 / 3 = " << 7 / 3 << endl;
cout << "7.0 / 3.0 = " << 7.0 / 3.0 << endl;
cout << "7 % 3 = " << 7 % 3 << endl;
cout << "7 + 3 * 5 = " << 7 + 3 * 5 << endl;
cout << "(7 + 3) * 5 = " << (7 + 3) * 5 << endl;
return 0;
}