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 numbers without using temp variable.

Answer Posted / sree

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
printf("Enter two numbers");
scanf("%d %d",&a &b);
a=a+b;
b=a-b;
a=a-b;
printf("The swapped values are:");
printf("a:%d",a);
printf("b:%d",b);
getch();
}

Is This Answer Correct ?    73 Yes 24 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I open a file so that other programs can update it at the same time?

1190


why return type of main is not necessary in linux

2113


What does the error message "DGROUP exceeds 64K" mean?

1229


Explain how can a program be made to print the name of a source file where an error occurs?

1199


How many levels of pointers can you have?

1201


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

1252


When should structures be passed by values or by references?

1050


I have written a pro*C program to fetch data from the cursor. where in i have used the concept of BULK FETCH.... each FETCH statement is taking lots of time to fetch specified number of rows at...

10210


What is sizeof in c?

1014


Explain what is output redirection?

1203


Why pointers are used in c?

1018


a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above

1396


What is the usage of the pointer in c?

1144


What are the 5 organizational structures?

1033


An integer that indentifies the position of a data item in a sequence of data items a) value b) number c) index d) all of the above

1221