"Being the richest man in cemetery doesn't matter to me..Going to bed at night saying we've done something wonderful..that's what matters to me."-Steve Jobs
c++ program that swap the value of two number without using other variable.
#include<iostream> using namesapace std; int main() { int a,b; cout<<"Enter the first number A:- \n"; cin>>a; cout<<"Enter the second number B:- \n"; cin>>b;
a=a+b; b=a-b; a=a-b; cout<<"The result is: \n"; cout<<"A: "<<a<<" , "<<"B: "<<b;
No comments:
Post a Comment