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 is static identifier?

1183


How can I recover the file name given an open stream or file descriptor?

1046


Write a program for Overriding.

1129


What is pragma in c?

1147


What is calloc() function?

1059


a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list

1023


Where are the auto variables stored?

1103


How can a program be made to print the name of a source file where an error occurs?

1186


What is the use of static variable in c?

1057


Why & is used in c?

1127


what do u mean by Direct access files? then can u explain about Direct Access Files?

2053


What does %p mean c?

1025


How can I make it pause before closing the program output window?

1006


How to implement a packet in C

2852


What is the difference between char array and char pointer?

1004