-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtut15.cpp
More file actions
35 lines (32 loc) · 794 Bytes
/
tut15.cpp
File metadata and controls
35 lines (32 loc) · 794 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 ){
// int c = a+b;
// return c;
// }
// Function prototype
// type funcation -name (arguments);
// int sum (int a, int b); -->Acceptable
// int sum (int a, b); --> Not Acceptable
// int sum (int , int ); --> Acceptable
int sum (int a, int b);
void g(void);
int main(){
int num1, num2;
cout <<"Enter first number "<<endl;
cin>> num1;
cout <<"Enter 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 values from actual parameters num1 and num2
int c = a+b;
return c;
}
void g(){
cout <<"Hello , G";
}