#include<iostream.h>
#include<conio.h>
void swap(int a,int b);
void main()
{
clrscr();
int a,b;
cout<<"enter 2 nos";
cout<<"\n\n";
cin>>a;
cout<<"\n\n";
cin>>b;
cout<<"\n\n";
cout<<"before swapping"<<"\n\n"<<"a="<<a;
cout<<"\n\n";
cout<<"b="<<b;
swap(a,b);
getch();
}
void swap(int a,int b)
{
cout<<"\n\n";
int temp;
temp=a;
a=b;
b=temp;
cout<<"after swapping"<<"\n\n"<<"a="<<a;
cout<<"\n\n";
cout<<"b="<<b;
}
#include<conio.h>
void swap(int a,int b);
void main()
{
clrscr();
int a,b;
cout<<"enter 2 nos";
cout<<"\n\n";
cin>>a;
cout<<"\n\n";
cin>>b;
cout<<"\n\n";
cout<<"before swapping"<<"\n\n"<<"a="<<a;
cout<<"\n\n";
cout<<"b="<<b;
swap(a,b);
getch();
}
void swap(int a,int b)
{
cout<<"\n\n";
int temp;
temp=a;
a=b;
b=temp;
cout<<"after swapping"<<"\n\n"<<"a="<<a;
cout<<"\n\n";
cout<<"b="<<b;
}