-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCODE10.cpp
More file actions
29 lines (25 loc) · 1.04 KB
/
CODE10.cpp
File metadata and controls
29 lines (25 loc) · 1.04 KB
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
#include<iostream>
using namespace std;
//LEARNLING ABOUT SWAP OF VALUE Call by Value & Call by Reference
// void nosw(int a,int b)
// {
// int c=a;
// a=b; <---------------THIS IS A TIPICAL METHOD OF SWAPING VALUE NO.1
// b=c;
// cout<<"this is value of a = "<<a<<endl;
// cout<<" this is value of b = "<<b<<endl;
// }
//*********** // void no1sw(int* a,int* b)
// {
// int c=*a;
// *a=*b; //<------------Call by VALUE NO.2
// *b=c;
// }
int main()
{
int a =44,b=55;
// nosw(a,b); <----------------THIS IS VALUE OF N0.1
// no1sw(&a,&b); //THIS IS CALL BY Call by VALUE NO.2
// cout<<"this is value of a = "<<a<<endl;
// cout<<"this is value of b = "<<b<<endl;
}