View Single Post
Old 10-09-2007, 12:47 AM   #75 (permalink)
aditya.shevade
Console Junkie
 
aditya.shevade's Avatar
 
Join Date: Jun 2006
Location: USA
Posts: 991
Default Re: Post ur C/C++ Programs Here

Easy. Check this out.

Code:
#include<iostream>

using namespace std;

main()
{
	int a, b;
	
	cout << "Enter A and B" << endl;
	cout << "a = ";
	cin >> a;
	cout << endl << "b = ";	
	cin >> b;
	
	a = ((b - a) + (b = a));
	
	cout << endl << "a = " << a << endl;
	cout << "b = " << b;
	
	return 0;
	
}
EDIT : Output :-

Code:
EXECUTING:
/home/aditya/test 
----------------------------------------------
Enter A and B
a = 12

b = 23

a = 23
b = 12
----------------------------------------------
Program exited successfully with errcode (0)
Press the Enter key to close this terminal ...
__________________
--- Console Junkie
aditya.shevade is offline