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 exchange two variaables without temp

Answer Posted / srinivas

main()
{
int a=3,b=2;

a = (a+b)-(b=a);

printf("a=%d,b=%d",a,b);
}
o/p:- a=2,b=3

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?

1035


a formula,a series of steps,or well defined set of rules for solving a problem a) algorithem b) program c) erdiagram d) compiler

1023


Explain the advantages and disadvantages of macros.

1035


What are variables c?

998


What library is sizeof in c?

1036


What is a rvalue?

1140


Explain how can I write functions that take a variable number of arguments?

1028


Is linux written in c?

990


When should structures be passed by values or by references?

995


Can a pointer be null?

975


Why is #define used?

1229


Can a local variable be volatile in c?

937


Is c# a good language?

963


What are structures and unions? State differencves between them.

1100


Define and explain about ! Operator?

953