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 to swap Two numbers without using temp variable.

Answer Posted / ajith c.k

#include"stdio.h"
int swap(int *,int*);
int main()
{
int a,b;
printf("enter two number");
scanf("%d%d",&a,&b);
swap(&a,&b);
printf("%d\t%d",a,b);
return ;
}
int swap(int *s,int *q)
{

if(*s==*q)
return;
*s^=*q;
*q^=*s;
*s^=*q;
return ;
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

When should structures be passed by values or by references?

1050


will u please send me the placement papers to my mail???????????????????

1841


What is 2c dna?

1085


What is function definition in c?

1084


Explain the difference between #include "..." And #include <...> In c?

1036


What is c language used for?

990


In c language can we compile a program without main() function?

1142


Why is extern used in c?

1095


What is the size of empty structure in c?

1086


What is declaration and definition in c?

1102


What is an lvalue?

1071


Explain what is a static function?

1115


How can I generate floating-point random numbers?

1134


Explain how can I make sure that my program is the only one accessing a file?

1227


What are qualifiers in c?

1042