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

Can a variable be both const and volatile?

1071


What is difference between main and void main?

1117


List at least 10 sorting methods indicating their average case complexity, worst case complexity and best case complexity.

2688


Explain what is the best way to comment out a section of code that contains comments?

1096


What is the use of header files?

1058


what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;

2367


Why & is used in scanf in c?

1050


What is maximum size of array in c?

991


What is a good data structure to use for storing lines of text?

1033


What are the c keywords?

1146


What is a structure member in c?

956


What are the advantages and disadvantages of a heap?

1147


What is the correct declaration of main?

1154


Can we assign integer value to char in c?

1157


What is main () in c language?

1078