lesson 6 showmath cpp
[[lesson_6_showmath_cpp]] last edit on Aug 9, 2005 2:07 AM by rescued_by_c

[user02@FC4 Lesson06]$ cat -n showmath.cpp
   1  #include <iostream>
   2  using namespace std;
   3
   4  int main()
   5  {
   6     cout << "5 + 7 = " << 5 + 7 << endl;
   7     cout << "12 - 7 = " << 12 - 7 << endl;
   8     cout << "1.2345 * 2 = " << 1.2345 * 2 << endl;
   9     cout << "15 / 3 = " << 15 / 3 << endl;
  10
  11     return 0;
  12  }
[user02@FC4 Lesson06]$ g++ -o showmath showmath.cpp
[user02@FC4 Lesson06]$ ./showmath
5 + 7 = 12
12 - 7 = 5
1.2345 * 2 = 2.469
15 / 3 = 5