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

Write a program to print "hello world" without using a semicolon?

1055


What is the purpose of the preprocessor directive error?

1262


What does a pointer variable always consist of?

1093


Can we increase size of array in c?

964


What is volatile variable in c with example?

1035


i have a written test for microland please give me test pattern

2728


What is meant by errors and debugging?

1099


write a program to rearrange the array such way that all even elements should come first and next come odd

2271


what do the 'c' and 'v' in argc and argv stand for?

1158


The % symbol has a special use in a printf statement. How would you place this character as part of the output on the screen?

1268


Explain how can I avoid the abort, retry, fail messages?

1042


In c language can we compile a program without main() function?

1126


What is the difference between printf and scanf in c?

1348


Why doesnt the call scanf work?

1186


What is unary operator?

1096