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 / ashish omar

Suppose: a = 3
b=2;

11
10
a = a ^ b;

11
10
==
01

b = a ^ b;
01
10
==
11

a = a ^ b;

01
11
==
10

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why do we use header files in c?

1067


Give differences between - new and malloc() , delete and free() ?

1095


What is the use of function in c?

1187


What is the use of sizeof?

1013


Which is not valid in C a) class aClass{public:int x;}; b) /* A comment */ c) char x=12;

1068


Write a C program to help a HiFi’s Restaurant automate its breakfast billing system. Your assignment should implement the following items: a. Show the customer the different breakfast items offered by the HiFi’s Restaurant. b. Allow the customer to select more than one item from the menu. c. Calculate and print the bill to the customer. d. Produce a report to present your complete program and show more sample output. Assume that the HiFi’s Restaurant offers the following breakfast menu: Plain Egg $2.50 Bacon and Egg $3.45 Muffin $2.20 French Toast $2.95 Fruit Basket $3.45 Cereal $0.70 Coffee $1.50 Tea $1.80

3123


Explain the use of bit fieild.

1137


Explain is it valid to address one element beyond the end of an array?

1208


Explain can the sizeof operator be used to tell the size of an array passed to a function?

1065


A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers

1190


What is difference between scanf and gets?

1263


What does typedef struct mean?

1105


how to capitalise first letter of each word in a given string?

1922


What are 'near' and 'far' pointers?

1035


Explain with the aid of an example why arrays of structures don’t provide an efficient representation when it comes to adding and deleting records internal to the array.

3145