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
What is private, public and protected inheritance?
program explaining feautures of c++
Write a function to perform the substraction of two numbers. Eg: char N1="123", N2="478", N3=-355(N1-N2).
Show the declaration for a pointer to function returning long and taking an integer parameter.
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.
Mention the purpose of istream class?
What are the three forms of cin.get() and what are their differences?
What is lambda in c++?
Why can templates only be implemented in the header file?
What is c++ try block?
What is the difference between struct and class?
How to allocate memory dynamically for a reference?
Write about the various sections of the executable image?
What is setbase c++?
Describe Trees using C++ with an example.