Interchange the value

Program to Interchange the value of Two variables Using Temp Variable


#include<iostream.h>


#include<conio.h>

int main()

{

int a=0,b=0,temp=0;


cout<<"Enter the value of a : ";

cin>>a; 

cout<<"Enter the value of b: ";

cin>>b;


temp=a;
a=b;
b=temp;

cout<<"a="<<a<<endl<<"b="<<b<<endl;


getch();

return 0


}

 

OUTPUT

 







No comments :

Post a Comment