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 integers 1 and 32767 without using third
variable

Answer Posted / g.sai lakshmi priyanka

void main()
{
 int a,b;
 a=32767,b=1;
 a=a*b;
 b=a/b;
 a=a/b;
 printf("%d %d",a,b);
}
 EXPLAINATION:
 
a=32767*1=32767
b=32767/1=32767
a=32767/32767=1

a=1,b=32767

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

regarding pointers concept

2035


Is struct oop?

1002


What is the scope of an external variable in c?

1044


Do you know the use of fflush() function?

1059


Can we use visual studio for c?

1084


.main() { char *p = "hello world!"; p[0] = 'H'; printf("%s",p); }

1293


What is the use of printf() and scanf() functions?

1128


Write a c program to demonstrate character and string constants?

2191


can we change the default calling convention in c if yes than how.........?

2531


What is hash table in c?

1019


how to build a exercise findig min number of e heap with list imlemented?

2075


a c code by using memory allocation for add ,multiply of sprase matrixes

2796


How do you sort filenames in a directory?

1168


#include int main(){ int i=10; int *ptr=&i; *ptr=(int *)20; printf("%d",i); return 0; } Output: 20 can anyone explain how came the output is 20

1719


Which is the memory area not included in C program? give the reason

1944