swap 2 variables without using 3 rd variable???
Answers were Sorted based on User's Feedback
Answer / rajendra
let
A=10
B=20
after swaping A=20
B=10
ok
A = A + B (A = 20+10 = 30)
B = A - B (B = 20-10 = 10)---->B=10
A = A - B (A = 30-10 = 20)---->A=20
Thats all very simple
byee Friends
rajendra
rajendra prasad reddy
rajendra_penumalli@yahoo.com
9885162742
hyd
Is This Answer Correct ? | 9 Yes | 3 No |
Answer / guest
Ex:
1.
A=20,B=10
A=A-B=20-10=10
B=A+B=10+10=20
A=B-A=20-10=10
2.
A=6,B=4
A=A-B=6-4=2
B=A+B=2+4=6
A=B-A=6-2=4
The above logic works if A>B. If B>A:
B=6, A=4
B=B-A=6-4=2
A=A+B=4+2=6
B=A-B=6-2=4
Is This Answer Correct ? | 0 Yes | 0 No |
In The Manual Testing process, The team/member is not allowed to do any kind of code/unit or piece of code modifications. etc...,even though the members are aware of bug/ defect exists in the unit/code. Because the question falls under manual testing and even though I know how to do it, it is not out of the box question.
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / gm
Before Swaping
A = 10
B = 20
After Swapping
A = 20
B = 10
Solution:
B = B - A =(20-10) = 10 ---> B = 10
A = A + B =(10+10) = 20 ---> A = 20 (since B = 10 now)
Is This Answer Correct ? | 2 Yes | 3 No |
Answer / naresh
rajendra is correct
but the example he took is wrong...
Is This Answer Correct ? | 0 Yes | 2 No |
Answer / manu
sorry rejendra but i think u r wrong
u hae initially takn a=10 and b=20
ut had taken opposite values moreovr when u have performed
the operation a=a+b
now the value of a has become 30 not the previous 1
i think this will be done with the use of temp variable
Is This Answer Correct ? | 1 Yes | 5 No |
Hiei have cleared 2technical and hr round at sasken.hr even discussed about salary,he said there would be a client round which final.Can any one tell how to prepare for this round and what type questions i can expect.By the way this job is regarding 1+ exp on mobile app testing
How do you select test cases for Regression Testing(The point is when there is change code how do you come know which part of code or modules it will affect).
15 Answers CTS, HCL,
what is incosistent testing
Explain Agile testing with example?
What is the difference between baseline and traceability matrix?
what is verification and Validation?
what is alpha , beta testing ?
I have 2 yrs 10 months experience in manual testing. there is a gap of 3 yrs in between. just 3 months before i rejoined the same company. I am looking for new & better job.What I have to enhance my career to up level, should I have to do Automation course or any other. Guide me properly.
Can anybody find the bugs in this "allinterview.com" site???
Whar are the different types of defects/errors are commonly appear during the real time software testing?
can u tell me the recently u raised the critical defect? tell me u r own plzzzzzzz yar?
wht is Driver in Integration testing