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...

How many ways are there to swap two numbers without using
temporary variable? Give the each logic.

Answer Posted / chandan doki

void main()
{
int a,b;
printf("eneter any two values for a and b");
scanf("%d%d",&a,&b);
b=a+b;
a=b-a;
b=b-a;
printf("a=%d\nb=%d",a,b);
getch();
}

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

When can a far pointer be used?

1080


What is the difference between fread buffer() and fwrite buffer()?

1228


What is pass by value in c?

1134


Difference between Function to pointer and pointer to function

1130


What is a lookup table in c?

1175


Explain how can I convert a number to a string?

1207


What does it mean when a pointer is used in an if statement?

1156


How can you determine the size of an allocated portion of memory?

1361


What is the argument of a function in c?

1103


If a variable is a pointer to a structure, then which operator is used to access data members of the structure through the pointer variable?

1311


What does the function toupper() do?

1194


How can you increase the allowable number of simultaneously open files?

1212


Write a program to print factorial of given number using recursion?

1065


What is sizeof int in c?

1115


Are c and c++ the same?

1110