How to swap values between two variables without using a
third variable?
Answer Posted / sushma rani
Here we have two variable A=4, B=3
we need to swap values without taking any third variable
result should be A=3, B=4
for that we can do ,
A=A+B-A (e.g. A=4+3-4 => 3)
and
B=B+A-B (e.g. B=3+4-3 => 4)
That's it....
Thanks & Regards
Sushma Rani
Bangalore
===========
| Is This Answer Correct ? | 3 Yes | 7 No |
Post New Answer View All Answers
Find out the list of roles which gives access to GUI activities? thanks in advance
what is apt_dump_score in datastage where it is useful
How to call a C++ function which is compiled with C++ compiler in C code?
what will we require to build project with the help of oracle
1) How can u create the table?
What are events in smartforms?
what is the main usage of an abstract keyword?please follow the program class A { void display() { System.out.println("hai"); } void print() { } } class B extends A { void print() { System.out.println("Hello"); } } In this program i was gives the implementation of print() according to my requirements in subclass.And there is no definition in superclass then why we can use abstract keyword before a method that i want to gives definition in other classes,is any mistakes in the above usage of method?
what is adodb??y it is used for connection of V.B and access??what is ado?dao?
When we have two versions of the dot net installed how does the compiler know which version of DLL it has to select to an application.
what are importance in problem tracking
Write a pseudo code to evaluate a number to any base given (2...16) based on the input. Number greater than 9 should be given as A-F for 10-15.
Why did you ever become involved in QA/testing?
what do u mean by tagging
I have try to write a record in a TDQ from a fle.... what are the steps to do... can anybody plz come with a solution
Explain polymorphism. Provide an example.