how to swap two numbers with out using temp variable

Answer Posted / pranav

//swaping of 2 numbers without using temp variable
//a=5 & b=6
a=a+b; //a=30
b=a-b; //b=5
a=a-b; //a=6

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is using namespace std in c++?

601


We use library functions in the program, in what form they are provided to the program?

590


Which compiler does turbo c++ use?

596


Define a nested class. Explain how it can be useful.

627


Which ide is best for c++?

536






Can constructor be static in c++?

632


There are 100 students in a class. The management keep information in two tables. Those two tables are given like Roll no Name Age 001 ABC 15 002 XYZ 14 and Roll No Subject Marks 001 Math 75 001 Physics 55 002 Math 68 001 Hindi 69 They want the information like this Roll No Name Hindi Physics Math Total 001 ABC 69 55 75 199 002 XYZ 68 74 84 226 And Roll No Suject Highest 001 Math 98 007 Physics 84 021 Hindi 74 All 275 All information is kept in structure in main memory. You have to find last two tables.

2526


Write a Program to find the largest of 4 no using macros.

574


Define the process of handling in case of destructor failure?

568


What is the history of c++?

550


What are disadvantages of pointers?

559


Is python written in c or c++?

614


why is c++ called oops? Explain

578


What is abstract class in c++?

579


what is the use of void main() in C++ language?

634