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

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
printf("Enter two numbers");
scanf("%d %d",&a &b);
a=a+b;
b=a-b;
a=a-b;
printf("The swapped values are:");
printf("a:%d",a);
printf("b:%d",b);
getch();
}

Is This Answer Correct ?    73 Yes 24 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the different properties of variable number of arguments?

1102


What is struct node in c?

1021


If fflush wont work, what can I use to flush input?

1050


What is the difference between union and anonymous union?

1249


How to get string length of given string in c?

1009


Explain what is the concatenation operator?

1108


How can I access an I o board directly?

1036


What is the purpose of realloc()?

1093


What is 'bus error'?

1090


Is struct oop?

959


What is const keyword in c?

1122


p*=(++q)++*--p when p=q=1 while(q<=6)

1697


What is wrong with this statement? Myname = 'robin';

1263


What is the use of sizeof?

969


What is a stream?

1078