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 / yash paranjape

int main()
{
int a,b;
printf("enter the two numbers");
scanf("%d%d",&a,&b);
a^=b^=c^=a;//swap a and b
printf("%d%d",a,b);//numbers r swapped
}

Is This Answer Correct ?    82 Yes 189 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the different types of pointers used in c language?

1042


Describe how arrays can be passed to a user defined function

1289


Write a program to reverse a given number in c language?

1110


Why cant I open a file by its explicit path?

1027


What is the most efficient way to count the number of bits which are set in an integer?

1044


Explain what is the best way to comment out a section of code that contains comments?

1131


Explain what is #line used for?

1061


Once I have used freopen, how can I get the original stdout (or stdin) back?

1073


What is the collection of communication lines and routers called?

1120


Why c is known as a mother language?

1079


Is a house a shell structure?

1158


how can use subset in c program and give more example

1989


What are integer variable, floating-point variable and character variable?

1243


The number of measuring units from an arbitarary starting point in a record,area,or control block to some other point a) recording pointer b) offset c) branching d) none

1250


Write a program to show the change in position of a cursor using c

1053