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 / vigneswari

#include<iostream.h>
#include<conio.h>
void main()
{
int a,b,c,d;
cout<<"\n enter a:";
cin>>a;
cout<<"\n enter b:";
cin>>b;
c=a+b;
d=a-b;
c=a-b;
cout<<"\n answer a :"<<c;
cout<<"\n answer b:"<<d;
getch();
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the types of arrays in c?

1099


Is there any demerits of using pointer?

1018


What is a lookup table in c?

1049


Explain pointer. What are function pointers in C?

1018


What is main function in c?

1021


Explain what math functions are available for integers? For floating point?

1065


How can you check to see whether a symbol is defined?

1051


Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?

1036


How main function is called in c?

1076


what is a constant pointer in C

1098


What is file in c preprocessor?

1091


Differentiate between calloc and malloc.

1225


How can I run c program?

1132


#define PRINT(int) printf("int = %d ",int) main() {< BR> intx,y,z; x=03;y=02;z=01; PRINT(x^x); z<<=3;PRINT(x); y>>=3;PRINT(y); }

1132


What is the meaning of 2d in c?

1066