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 / r.aruna

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
clrscr();
printf("Enter the a value");
scanf("%d",&a);
printf("Enter the b value");
scanf("%d",&b);
a=a+b;
b=a-b;
a=a-b;
printf("After swapping a,b value",a,b);
getch();
}

Is This Answer Correct ?    11 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Are the outer parentheses in return statements really optional?

1122


Which is best book for data structures in c?

1095


What is the scope of an external variable in c?

1050


What header files do I need in order to define the standard library functions I use?

1063


What is bubble sort in c?

1057


What is return in c programming?

979


string reverse using recursion

2479


Explain c preprocessor?

1120


What is || operator and how does it function in a program?

1100


What is the purpose of sprintf() function?

1133


What is #line in c?

1019


the 'sizeof' operator reported a larger size than the calculated size for a structure type. What could be the reason?

1004


What is malloc calloc and realloc in c?

1338


What does it mean when a pointer is used in an if statement?

1113


Find duplicates in a file containing 6 digit number (like uid) in O (n) time.

3250