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;

cout<<"enter a";
cin>>a;
cout<<"b";
cin>>b;


a=a+b;
b=a-b;
a=a-b;

cout<<"a="<<a<<"\n";
cout<<"b="<<b<<"\n";
getch();
}

Reactions:

0 comments :

Post a Comment