Saturday, September 19, 2015

HOW TO SWAP TWO NUMBER ?

#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a = 10, b= 20, temp;

cout<<"Before Swapping"<<endl<<a<<"\t"<<b<<endl<<endl;

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

cout<<"After Swapping"<<endl<<a<<"\t"<<b<<endl<<endl;

getch();
}

visit : www.indiaknow.com

No comments:

Post a Comment