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 / ankit

a=a+b;
b=a-b;
a=a-b;

example int a=2;int b=3
put a=2 & b=3
a=2+3;
b=5-3;
a=5-2;
a=3;
b=2;

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is character set?

1113


Is register a keyword in c?

992


What is boolean in c?

1029


stripos — Find position of first occurrence of a case- insensitive string int stripos ( char* haystack, char* needle, int offset ) Returns the numeric position of the first occurrence of needle in the haystack string. Note that the needle may be a string of one or more characters. If needle is not found, stripos() will return -1. The function should not make use of any C library function calls.

2398


What is the mean of function?

1062


An instruction which is analysed and acted upon by the processor prior to the compiler going its work a) directive b) constructive c) constant d) absolute mode

1026


What is derived datatype in c?

1038


What is c programing language?

1041


What are the header files used in c language?

989


What is class and object in c?

1044


What is conio h in c?

1000


please give me some tips for the placement in the TCS.

2050


pgm to find any error in linklist(in single linklist check whether any node points any of previous nodes instead of next node)

2574


Is it acceptable to declare/define a variable in a c header?

1059


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

1130