-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtut15.cpp
More file actions
35 lines (31 loc) · 758 Bytes
/
Copy pathtut15.cpp
File metadata and controls
35 lines (31 loc) · 758 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
#include <iostream>
using namespace std;
int sum(int a, int b)
{
// Formal Parameters a and b will be taking values from actual parameters num1 and num2.
int c;
c = a + b;
return c;
}
// Function prototype
// Type function name arguments
// int sum(int a, int b); //--> Acceptable
// int sum(int a, b); //--> Not Acceptable
// int sum(int, int); //--> Acceptable
void g(void); //--> Acceptable
// void g(); //--> Acceptable
int main()
{
int n1, n2;
cout << "Enter the n1; " << endl;
cin >> n1;
cout << "Enter the n2; " << endl;
cin >> n2;
// num1 and num2 are actual parameters
cout << "The additon of n1 and n2 is: " << sum(n1, n2) << endl;
g();
return 0;
}
void g(){
cout<<"\n Good morning";
}