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 are the advantage of c language?

1054


Explain what is the advantage of a random access file?

1126


write a program to display all prime numbers

1973


A collection of functions,calls,subroutines or other data a) library b) header files c) set of files d) textfiles

1179


What is hash table in c?

1025


What are the types of i/o functions?

1349


What are header files in c programming?

1138


what is a function method?give example?

2373


When is a null pointer used?

1121


How will you declare an array of three function pointers where each function receives two ints and returns a float?

1376


Why clrscr is used after variable declaration?

1695


Differentiate between calloc and malloc.

1276


What are actual arguments?

1101


what are the facialities provided by you after the selection of the student.

2265


how logic is used

1976