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

#include<stdio.h>
#include<conio.h>
main()
{
int a,b;
printf("\n BEFORE SWAPPING THE NOS");
printf("\n enter the a, b values");
scanf("%d %d",&a,&b);
swap(&a,&b);
printf("\n AFTER SWAPPING THE NOS");
printf("\n a=%d",a);
printf("\n b=%d",b);
getch();
}
swap(int *x,int *y)
{
int t;
t=*x;
*x=*y;
*y=t;
return();
}

Is This Answer Correct ?    5 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the g value paradox?

1121


Explain what are reserved words?

1057


write a c program to calculate sum of digits till it reduces to a single digit using recursion

3264


What are the advantages and disadvantages of c language?

976


we need to calculating INCOME TAX for the person. The INCOME TAX is as follows:- First $10000/- of income : 4% tax Next $10000/- of income : 8% tax Next $10000/- of income : 11.5% tax above $10, 00,00/- : 15% tax What is the Solution of this Question ?

1223


What is volatile variable in c with example?

1010


Explain built-in function?

1103


What is the difference between a string and an array?

1172


how to write optimum code to divide a 50 digit number with a 25 digit number??

3219


What is sorting in c plus plus?

946


Here is a good puzzle: how do you write a program which produces its own source code as output?

1057


What is storage class?

1021


What are the features of c language?

1033


how to write a c program to print list of fruits in alpabetical order?

2254


How can I recover the file name given an open stream or file descriptor?

1046