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 to swap two values using a single variable ?

condition: Not to use Array and Pointer ?

Answer Posted / ankit anupam

well i think this was wht u were lookin for
#include<stdio.h>
int main()
{
int a, b;
printf("Enter two no");
scanf("%d%d",&a,&b);
printf("a=%d nd b=%d",a,b);
a=a+b;
b=a-b;
a=a-b;
printf("a=%d nd b=%d",a,b);
return 0;
}

Is This Answer Correct ?    16 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between text and binary i/o?

1047


Difference between pass by reference and pass by value?

1154


What is spaghetti programming?

1127


What are the advantages of the functions?

1158


Why c language?

1054


Device an algorithm for weiler-atherton polygon clipping, where the clipping window can be any specified polygon

5947


Is it possible to use curly brackets ({}) to enclose single line code in c program?

1316


Why doesnt the call scanf work?

1189


What is 2c dna?

1075


#include main() { enum _tag{ left=10, right, front=100, back}; printf("left is %d, right is %d, front is %d, back is %d",left,right,front,back); }

1114


Can a variable be both const and volatile?

1128


Why c is called free form language?

1020


Are the expressions * ptr ++ and ++ * ptr same?

1145


What is a buffer in c?

997


what is a function method?give example?

2356