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

Do pointers store the address of value or the actual value of a variable?

1022


What is getche() function?

989


What does the file stdio.h contain?

1001


Can a function be forced to be inline? Also, give a comparison between inline function and the C macro?

1050


When do you not use the keyword 'return' when defining a function a) Always b) Never c) When the function returns void d) dfd

1016


Does c have enums?

1028


Explain what is page thrashing?

1056


#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }

1089


Why cant I open a file by its explicit path?

991


Why is extern used in c?

1053


Explain about C function prototype?

1029


What is dynamic variable in c?

990


Explain how do you override a defined macro?

1021


Why do we need functions in c?

958


Why static is used in c?

1035