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 does the file stdio.h contain?

1054


How we can insert comments in a c program?

1114


How to check whether string is a palindrome, WITHOUT USING STRING FUNCTIONS?

16754


Explain the bubble sort algorithm.

1052


Are there any problems with performing mathematical operations on different variable types?

1036


What is the difference between array and pointer in c?

1154


Explain what are run-time errors?

1079


write a program that declares an array of 30 elements named "income" in the main functions. then cal and pass the array to a programmer-defined function named "getIncome" within the "getIncome" function, ask the user for annual income of 30 employees. then calculate and print total income on the screen using the following function: "void getIncome ( ai []);

2351


What does node * mean?

1193


What is extern c used for?

1054


What is the use of printf() and scanf() functions?

1121


Why isnt there a numbered, multi-level break statement to break out

1041


What is the use of header?

1085


Explain what are the __date__ and __time__ preprocessor commands?

1112


#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }

1128