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 temporary
variable?

Answer Posted / it diploma student

let a and b be the variables

a=a+b
b=a-b
a=a-b

if we take a=5 and b = 7 then

a = 5+7 = 12
b = 12-7 = 5
a = 12-5 = 7

hence swaped...

Is This Answer Correct ?    26 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

WHICH TYPE OF JOBS WE GET BY WRITING GROUPS .WHEN THE EXAMS CONDUCTED IS THIS EXAMS ARE CONDUCTED EVERY YEAR OR NOT.PLS TELL ME THE ANSWER

1858


Write a C program in Fibonacci series.

1086


Do character constants represent numerical values?

1335


A collection of functions,calls,subroutines or other data a) library b) header files c) set of files d) textfiles

1174


What is c language & why it is used?

1105


What is pointers in c?

1112


How can I prevent another program from modifying part of a file that I am modifying?

1053


What is the modulus operator?

1206


What is break statement?

1120


What is the use of function in c?

1190


what is the basis for selection of arrays or pointers as data structure in a program

4305


How does selection sort work in c?

1033


Want to know how to write a C program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.

2051


Write a program to replace n bits from the position p of the bit representation of an inputted character x with the one's complement. Method invertBit takes 3 parameters x as input character, p as position and n as the number of positions from p. Replace n bits from pth position in 8 bit character x. Then return the characters by inverting the bits.

4205


Why header file is used in c?

1089