Wednesday 17 July 2013



//// swap 2 numbers ////

#include "stdafx.h"
#include "stdio.h"
#include "conio.h"
#include "iostream"

using namespace std;


int _tmain(int argc, _TCHAR* argv[])
{
       int a=0;
       int b=0;
       int swap=0;
       cout<<"enter a";
       cin>>a;
       cout<<"b";
       cin>>b;
       swap=a;
       a=b;
       b=swap;
       cout<<"a="<<a<<"\n";
       cout<<"b="<<b<<"\n";
       getch();
}

0 comments :

Post a Comment