Skip to content

Commit 66d0a1f

Browse files
committed
add 006_functions.cpp file
1 parent 4674c75 commit 66d0a1f

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

006_functions.cpp

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#include<iostream>
2+
3+
long int add (int nVar1, int nVar2) {
4+
return nVar1+nVar2;
5+
}
6+
7+
int substract (int nVar1, int nVar2){
8+
return nVar1-nVar2;
9+
}
10+
11+
void say_hello(void){
12+
std::cout << "Hello, I'm a Function/Method." << '\n';
13+
}
14+
15+
int main(int argc, char const *argv[]) {
16+
long int lnResult;
17+
lnResult = add(5,2);
18+
std::cout << "Addition: " << lnResult << '\n';
19+
20+
std::cout << "Substraction: " << substract(10,7) << '\n';
21+
22+
say_hello();
23+
24+
return EXIT_SUCCESS;
25+
}

0 commit comments

Comments
 (0)