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 / senthil mca sns

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

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the benefits of organizational structure?

1019


Are the variables argc and argv are local to main?

1315


Are comments included during the compilation stage and placed in the EXE file as well?

1078


What is s or c?

1060


List some of the static data structures in C?

1196


Why is main function so important?

1099


What is scanf () in c?

1124


Describe dynamic data structure in c programming language?

1091


Explain c preprocessor?

1107


What is pragma c?

1112


What do you mean by a local block?

1084


What is atoi and atof in c?

1083


How is actual parameter different from the formal parameter?

1021


In C language, a variable name cannot contain?

1272


Where register variables are stored in c?

959