-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtut15.cpp
40 lines (34 loc) · 940 Bytes
/
tut15.cpp
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
#include<iostream>
using namespace std;
void name(){
cout<<"Author: Varun Gupta"<<endl;
}
// Function Definition.
int sum(int a ,int b);
void gip();
int main(){
name();
//funtion prototype
//type function-name(arguments)
//int sum(int a, int b) //--> Acceptable
//int sum(int , int ) //--> Acceptable
//int sum(int a, b) //--> Not Acceptable
int num1,num2;
cout<<"Enter the value of :"<<num1<<endl;
cin>>num1;
cout<<"Enter the value of numb2"<<num2<<endl;
cin>>num2;
//Actual parameters are num1 and num2
cout<<"The sum is: \n"<<sum(num1 ,num2)<<endl;
gip();
return 0;
}
int sum(int a , int b) // Formal paremeters a and b are taking value from actual paremeter num1 and num2.
{
// int c= a+b;
// cout<<c;
return a+b;
}
void gip(){
cout<<"Hi! How are you!"<<endl;
}