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

#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 ?    604 Yes 119 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is the basis for selection of arrays or pointers as data structure in a program

4299


Which is best linux os?

1022


Can you explain what keyboard debouncing is, and where and why we us it? please give some examples

2187


What is return in c programming?

962


How is a null pointer different from a dangling pointer?

1010


Want to know how to write a C program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.

2046


Please send me WIPRO technical question to my mail ID.. its nisha_g28@yahoo.com please its urgent

2118


write a program to generate address labels using structures?

4567


Why do we use return in c?

991


How do shell structures work?

1105


void main(int n) { if(n==0) return; main(--n); printf("%d ",n); getch(); } how it work and what will be its output...............it any one know ans plz reply

2765


Write a program to identify if a given binary tree is balanced or not.

1150


Why is c known as a mother language?

1234


What are the two forms of #include directive?

1158


Do you know pointer in c?

1038