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

# include "stdio.h"
main()
{
int a,b;
printf("enter two numbers for swaping");
scanf("%d%d",&a,&b);
a=a+b;
b=a-b;
a=a-b;
printf("a is %d",a);
printf("b is %d",b);
} output:- takea,b value is 2,3 and give answers is3,2

Is This Answer Correct ?    243 Yes 58 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Here is a good puzzle: how do you write a program which produces its own source code as output?

1108


How can a number be converted to a string?

1342


What are the different types of control structures?

1048


What is #include stdlib h?

1112


What is the concatenation operator?

1156


swap 2 numbers without using third variable?

1141


Explain what are reserved words?

1111


diff between exptected result and requirement?

2064


why programs in c are running with out #include? some warnings are display in terminal but we execute the program we get answer why? eg: main() { printf("hello world "); }

1772


Can an array be an Ivalue?

1101


Is this program statement valid? INT = 10.50;

1167


What is the use of a conditional inclusion statement in C?

1070


Can we access the array using a pointer in c language?

1053


Explain what would happen to x in this expression: x += 15; (assuming the value of x is 5)

1286


Explain how can you check to see whether a symbol is defined?

1210