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

void main()
{
int a,b;
printf("enter the two numbers");
scanf("%d%d",&a,&b);
a^=b^=a^=b;
printf("%d%d",a,b);//swapped no
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a scope resolution operator in c?

1277


What is 2c dna?

1083


What is output redirection?

1224


what is recursion in C

1071


How is a structure member accessed?

1136


Can we add pointers together?

1062


What is the general form of a C program?

1031


Why doesnt the call scanf work?

1196


What is a null string in c?

1049


How can I ensure that integer arithmetic doesnt overflow?

1173


What is the difference between array_name and &array_name?

1307


Can I use base-2 constants (something like 0b101010)? Is there a printf format for binary?

1006


What is the use of a conditional inclusion statement in C?

1070


What do you mean by dynamic memory allocation in c? What functions are used?

1169


What functions are used for dynamic memory allocation in c language?

1153