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

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,temp;
scanf("%d%d",&a,&b);
printf("before swapping value of a=%d and b=%d",a,b);
temp=x;
x=y;
y=temp;
printf("after swapping value of a=%d and b=%d",a,b);
getch();
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I use void main?

1052


What Is The Difference Between Null And Void Pointer?

1156


Is there a way to switch on strings?

1028


Explain what does the characters 'r' and 'w' mean when writing programs that will make use of files?

1201


Is there a built-in function in C that can be used for sorting data?

1180


What is the argument of a function in c?

991


What are the types of arrays in c?

1095


Explain what would happen to x in this expression: x += 15; (assuming the value of x is 5)

1217


What is ponter?

1224


What is the use of bitwise operator?

1068


When was c language developed?

1141


Differentiate between a for loop and a while loop? What are it uses?

1132


What is huge pointer in c?

1023


Can you apply link and association interchangeably?

1071


Why is structure important for a child?

1049