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 variables a=5 , b= 10 without
using third variable

Answer Posted / shafi.shaik

main()
{
int a,b;
clrscr();
printf("enter a, b Value");
scanf("%d%d",&a,&b);
printf("\n%d",a);
printf("\n%d",b);
b=b-a;
a=a+b;
b=a-b;
printf("\n%d",a);
printf("\n%d",b);
getch();
}

Is This Answer Correct ?    1 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

write a program in C that prompts the user for today's date,tomorrow's date and display the results.Use structures for today's date,tomorrow's date and an array to hold the days for each month of the year.

5420


When should I declare a function?

1080


Why c is procedure oriented?

1019


What is pointer in c?

1151


Design a program which assigns values to the array temperature. The program should then display the array with appropriate column and row headings.

2288


What's a good way to check for "close enough" floating-point equality?

1116


What is data structure in c and its types?

1038


Differentiate between null and void pointers.

1135


What is maximum size of array in c?

1008


which of the following is allowed in a "C" arithematic instruction a) [] b) {} c) () d) none of the above

1679


Differentiate between static and dynamic modeling.

1069


What are qualifiers?

993


What are the advantages of using linked list for tree construction?

1045


How can I trap or ignore keyboard interrupts like control-c?

1036


Does c have circular shift operators?

1204