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 interchange two variables without using
the third variable?

Answer Posted / neelam

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
clrscr();
printf("Enter two no.s 4 swap");
scanf("%d%d",&a,&b);
a=a+b;;
b=a-b;
a=a-b;
printf("After swapping no.s are =\n");
printf("a=%d b=%d",a,b);
getch();
}

Is This Answer Correct ?    0 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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)

1099


Explain what will be the outcome of the following conditional statement if the value of variable s is 10?

1186


What are the usage of pointer in c?

1122


How can I sort a linked list?

973


How can I manipulate individual bits?

984


How can I copy just a portion of a string?

1272


what do you mean by inline function in C?

1008


The % symbol has a special use in a printf statement. How would you place this character as part of the output on the screen?

1222


Can an array be an Ivalue?

1055


What are 3 types of structures?

1027


What is the best way to store flag values in a program?

1010


What is difference between class and structure?

1064


Is c high or low level?

963


What are the 32 keywords in c?

1042


HOW TO SOLVE A NUMERICAL OF LRU IN OS ??????

2638