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 in C to swap two variables

Answer Posted / srinivas

#include <stdio.h>

int main(void)
{
int a = 2, b = 5;

a = a + b;
b = a - b;
a = a - b;
printf("%d\t%d\n", a, b);
return 0;
}

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the types of bitwise operator?

1107


What is the use of clrscr?

1102


what are the 10 different models of writing an addition program in C language?

1892


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

2123


What is pointer & why it is used?

1109


write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.

2824


what are the different storage classes in c?

1177


What is the difference between the = symbol and == symbol?

1109


Is main a keyword in c?

1129


formula to convert 2500mmh2o into m3/hr

989


what are enumerations in C

1160


Write a program to print “hello world” without using semicolon?

1118


What are the advantages of union?

1067


What does s c mean on snapchat?

1106


Why is it usually a bad idea to use gets()? Suggest a workaround.

1778