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

pgm to find any error in linklist(in single linklist check whether any node points any of previous nodes instead of next node)

2697


what is diffrence between linear and binary search in array respect to operators?what kind of operator can be used in both seach methods?

1919


Explain setjmp()?

1119


Explain how are portions of a program disabled in demo versions?

1173


What are actual arguments?

1158


Are pointers integer?

1074


What are the uses of null pointers?

1198


What is the size of a union variable?

1100


a program that can input number of records and can view it again the record

1964


What are the 5 data types?

1211


How do you list a file’s date and time?

1115


What do you mean by scope of a variable in c?

1059


How we can insert comments in a c program?

1190


Is it fine to write void main () or main () in c?

1077


Is c still used?

1097