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
Code for display the images from drive using vb 6.0?
Differevce between arrays and array builders?
MOV.CB 007H,ADCON1 MOVE.CT 001H,_OPTION_REG_7 MOV.CB 007H,CMCON
Write a shell program where you enter a number which corresponds to K.M. Find out the corresponding values in m, cm, inches, and feet. Hints:- 1 k.m= 1000 m 1 m= 100 cm 1 inches= 2.54 cm. 1 feet= 12 inches
how many types of operating system are avaliable?
What is the use of Differ interface check box in Ship confirm?
hai i am mca 2009 fresher.please tell me which certification helps me to get an IT job faster which institute is good in hyderabad.please mail me to prasanna.1856@rediff.com
how to convert hashmap to arraylist with iteration
8.In DSP,Define Signal and System?and various type of signals.
Diffrence between 2.0,3.0,3.5,4.0. versions of .net?
Given an array of size n. It contains numbers in the range 1 to n. Each number is present at least once except for 2 numbers. Find the missing numbers.
design a counter with the following repeated binary sequence: 0, 1, 2, 3, 4, 5, 6, 7, 8 using JK Flip Flop.
Write a program to find whether a given number is prime or not.
Do not use more than 3 nested IF. Use Evaluate statement in case of more IF required. Please give a detail explantion besides readability and clarity for Evaluate stmt.
we create a pf with 3 fields.2 is defined as keyfields.we lock it with alcobj command.how we find out whether the file is locked or not?is it dspfd??/