Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

write a program to swap Two numbers without using temp variable.

Answer Posted / diponkor roy

#include<iostream>
using namespace std;

int main()
{
int x,y;
cin>>x;
cin>>y;
cout<<"You enter"<<x <<" and"<<y<<endl;
x=x*y;
y=x/y;
x=x/y;
cout<<"After swap your number "<<x <<" and"<<y<<endl;
return 0;
}

Is This Answer Correct ?    2 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is extern used in c?

1145


How do you define a string?

1148


How to explain the final year project as a fresher please answer with sample project

1024


Calculate 1*2*3*____*n using recursive function??

2097


What will be the outcome of the following conditional statement if the value of variable s is 10?

1370


How can I read and write comma-delimited text?

1123


What is meant by gets in c?

1264


How can you return multiple values from a function?

1164


How a string is stored in c?

1116


How can you determine the maximum value that a numeric variable can hold?

1297


What the advantages of using Unions?

1291


Explain which function in c can be used to append a string to another string?

1138


When should we use pointers in a c program?

1194


int main() { Int n=20,i; For(i=0;i<=n;i--) { Printf(“-“); Return 0;

1926


What is an example of structure?

1097