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 / yash paranjape

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

Is This Answer Correct ?    82 Yes 189 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are lookup tables in c?

1033


1234554321 1234 4321 123 321 12 21 1 1 12 21 123 321 1234 4321 1234554321

3781


What are the different types of control structures?

1082


Can the curly brackets { } be used to enclose a single line of code?

1216


How can I convert a number to a string?

1249


What are header files in c?

1120


What is the best organizational structure?

1169


What is strcmp in c?

1212


Why & is used in scanf in c?

1146


What are linker error?

1150


What is the difference between functions abs() and fabs()?

1207


How can I implement sets or arrays of bits?

1092


Explain what is a 'locale'?

1127


How can a program be made to print the name of a source file where an error occurs?

1265


Can you write the function prototype, definition and mention the other requirements.

1197