[user02@FC4 Lesson10]$ cat -n addvalue.cpp
1 #include <iostream>
2 using namespace std;
3
4 int add_values(int a, int b)
5 {
6 return(a+b);
7 }
8
9 int main()
10 {
11 cout << "100 + 200 = " << add_values(100, 200) << endl;
12 cout << "500 + 501 = " << add_values(500, 501) << endl;
13 cout << "-1 + 1 = " << add_values(-1, 1) << endl;
14
15 return 0;
16 }
[user02@FC4 Lesson10]$ g++ -o addvalue addvalue.cpp[user02@FC4 Lesson10]$ ./addvalue
100 + 200 = 300
500 + 501 = 1001
-1 + 1 = 0
[user02@FC4 Lesson10]$
lesson_10_addvalue.cpp, Rev. 1, Last changed on 2005-08-18 06:05, 265 page hits