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 / amit chauhan

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
printf("\n Enter the 2 numbers");
scanf("%d%d",&a,&b);
//swaping of 2 numbers without using temp variable
a=a+b;
b=a-b;
a=a-b;
/* or
a=a*b;
b=a/b;
a=a/b;
*/
printf("\n A = %d \n B = %d\n");
getch();
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain 'bus error'?

1008


What is conio h in c?

998


Why calloc is better than malloc?

968


How can I manipulate individual bits?

981


What is && in c programming?

1108


hw can we delete an internal node of binary search tree the internal node has child node..plz write progarm

1964


What is dynamic variable in c?

985


What is function and its example?

1106


What is the difference between arrays and pointers?

1063


Can you define which header file to include at compile time?

979


What are extern variables in c?

943


how to find binary of number?

4332


Explain can static variables be declared in a header file?

1100


What is the time and space complexities of merge sort and when is it preferred over quick sort?

1007


write a program to find out prime number using sieve case?

2030