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
what is the work of 1tier,2tier,&ntier? Plz Explain it!
what is c sharp dotnet
What r the attributes using in Win Runner?
What is autocall macro and how to create autocall macro? what is the use of it?
Write a program to find whether a given number is prime or not.
there are N number of matchboxes numbered 1...N.each matchbox contain various number of stick.Two player can alternatevely pick some amount of stick from the higest stick containing box . The player is condidered win if there is no stick after his move.Find the final move so that the move player win. Note:In case the number of stick is equal ,pick the stick from the higest numbered box. eg: 3 box contain stick as:1,1,1. if u take 1 stick from 3rd numbred box you will any how win the match.
when will triggars the at new event in abap and web dybn pro?
What is WEB 3.0? What are the features their in WEB3.0
HOW TO FIND NUMBER OF TWOS IN N!(N FACTORIAL)??
How can recruiter justified that the candidate is expert in Algorithm and datastructure for Software product development ?
what is the difference between rename and label
in network security,how we identified threat?some one say we found threat according to it's signature,but how we get signature or pattern of the virus?
public static void main(String args[]) describe it
Which language they use during interview?
Can i please VHDL code for D-Latch with clear input ?? (HINT: Set up a “Process” with appropriate sensitivity list to get the desired D-Latch with Clr working.) Inputs and Outputs: entity Lab4b is Port ( Clr, Clk, D : in STD_LOGIC; Q : out STD_LOGIC); end Lab4b;