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 prgram of swapping with 2 valiables

Answer Posted / vijay r15

#include<stdio.h>
Void main()
{
int a=10,b=20;
a=a+b-(a=b);
// or use temp var
//or use a^=b^=a
//or use a=a+b;b=a-b;a=a-b;
printf("%d%d",a,b);
}

Any dbt mail to raj.vijay55@gmail.com

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a lookup table in c?

1173


What is the easiest sorting method to use?

1241


What is c token?

1123


What are enumerated types?

1267


How do you define a string?

1148


What does typeof return in c?

1160


How do I use void main?

1145


Explain how do you view the path?

1222


Differentiate between a for loop and a while loop? What are it uses?

1234


What is a structure member in c?

1051


What is the use of sizeof?

1064


Which operators cannot be overloaded a) Sizeof b) .* c) :: d) all of the above

1192


How do you view the path?

1182


Explain 'far' and 'near' pointers in c.

1186


How can I insert or delete a line (or record) in the middle of a file?

1069