- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctionEx.cpp
More file actions
Latest commit
41 lines (27 loc) · 547 Bytes
/
Copy pathfunctionEx.cpp
File metadata and controls
41 lines (27 loc) · 547 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include<iostream>
#include<string>
usingnamespacestd;
intaddTwo(int input) //here is the secondary function
{
int result = input + 2;
return result;
}
intmulti(int a, int b)
{
return a*b;
}
//a void function witch returns nothing
voidhelloWorld()
{
cout << "hello world !" << endl;
}
intmain()
{
int a = 2, b = 2;
b = addTwo(a);
cout << b << endl; //4
int c = multi(a, b);
cout << c << endl; //8
helloWorld(); //function just say hello world without returning anything
return0;
}