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 / george washington

Suppose:
x=1
y=3

Redefine:
x=x+y; //Or, x=1+3=4 and
y=x-y; // y=4-3=1 and
x=x-y; // x=4-1=3

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is the structure pointer?

2121


Suppose we have a table name EMP as below. We want to perform a operation in which, I want to change name ‘SMITH’ from as ‘SMITH JAIN’. Also I want to change the name of the column from ENAME to E_NAME. EMPNO ENAME JOB MGR HIREDATE SAL 7369 SMITH Coder 7902 17-DEC-80 800 7499 ALLEN SALESMAN 7698 20-FEB-81 1600 7521 WARD SALESMAN 7698 22-FEB-81 1250

1957


What is c token?

1064


Why is c platform dependent?

1084


What is null pointer constant?

1149


What do you mean by dynamic memory allocation in c? What functions are used?

1160


What is omp_num_threads?

1077


What is the difference between the local variable and global variable in c?

960


What is scanf_s in c?

1113


How do you generate random numbers in C?

1193


What is type qualifiers?

1130


What is the size of a union variable?

1053


How can I implement a delay, or time a users response, with sub-second resolution?

1071


What is data structure in c and its types?

1068


What is the explanation for cyclic nature of data types in c?

1206