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 / saurav raj

#include<stdio.h>
#include<conio.h>

void main()
int a,b;
clrscr();
printf("Enter Two number a & b:- ");
scanf("%d%d",&a,&b);
a=a+b;
b=a-b;
a=a-b;
printf("\nA=%d \t B=%d",a,b);
getch();

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why we use break in c?

1001


Explain how does free() know explain how much memory to release?

1066


What are the data types present in c?

1158


Explain how do you generate random numbers in c?

1078


What is scope rule of function in c?

1084


What does do in c?

1038


How can I read/write structures from/to data files?

967


What is the right way to use errno?

1044


What are the advantages and disadvantages of c language?

1012


What is a structural principle?

1160


Why is struct padding needed?

1081


What does the && operator do in a program code?

1215


What are categories used for in c?

1091


Is it possible to pass an entire structure to functions?

994


What functions are used in dynamic memory allocation in c?

1072