-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtut15.cpp
More file actions
32 lines (28 loc) · 728 Bytes
/
Copy pathtut15.cpp
File metadata and controls
32 lines (28 loc) · 728 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
#include<iostream>
using namespace std;
//Function Prototype
// type function-name (arguments);
//int sum (int a, int b); //---> Acceptable
//int sum (int a, b); //--->Not Accetable
int sum (int, int); //---> Acceptable
void g(void);
// void g(); //---> Acceptable
int main(){
int num1, num2;
cout<<"Enter your first number"<<endl;
cin>>num1;
cout<<"Enter your second number"<<endl;
cin>>num2;
// num1 and num2 are ACTUAL PARAMETERS
cout<<"The sum is "<<sum(num1, num2);
g();
return 0;
}
int sum(int a, int b){
// FORMAL PARAMETERS a and b will be taking value from the actual parameters num1 and num2
int c = a + b;
return c;
}
void g(){
cout<<"\nHello, Good morning";
}