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 four numbers without using fifth variable?

Answer Posted / srinija jilugu

#include<stdio.h>
void main()
{
int a,b,c,d;
printf("enter values\n");
scanf("%d %d %d %d",&a,&b,&c,&d);
printf("before swapping\n");
printf("%d %d %d %d",a,b,c,d);
a=(a+b);
b=(a-b);
a=(a-b);
c=(c+d);
d=(c-d);
c=(c-d);
printf("after swapping:%d %d %d %d",&a,&b,&c,&d);
}

Is This Answer Correct ?    23 Yes 19 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is self-referential structure in c programming?

1280


Tell me what are bitwise shift operators?

1172


What is operator precedence?

1280


What is indirection?

1150


Tell us two differences between new () and malloc ()?

1275


write a c program to find the sum of five entered numbers using an array named number

2203


What is the use of sizeof () in c?

1099


How can I call a function with an argument list built up at run time?

1285


What does 2n 4c mean?

1310


Program to find the sum of digits of a given number until the sum becomes a single digit. (e.g. 12345=>1+2+3+4+5=15=>1+5=6)

1206


in programming languages a statement or part of a statement that specifies several different execution sequences a) constructs b) distructs c) executes d) none

1155


What is #include stdlib h?

1145


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

1998


What would happen to X in this expression: X += 15; (assuming the value of X is 5)

2018


What is the difference between ++a and a++?

1272