How to swap values between two variables without using a
third variable?
Answer Posted / banti sharma
Miss Sobha upto My Knowlegde the answer of "Shiv" was most
appropriate and if you have Any knowledge of Programming I
repeat again "Any knowledge of programming" then you may
find it out yourself that Bitwise Shift Operation is much
more time Efficient then that of "+","-","*","/.And if I say
about my answer then it is also correct having No mistakes
as the Question is "How to swap values between two variables
without using a third variable?" so if you read it carefully
then it does not say anywhere to print the Swaped values.I
think you have got Y i wrote like that,IF I say about
another logic then one more logic may be used like:
a=a*b;
b=a/b;
a=a/b;
though I m using Multiply and Devision still its better then
my past logic(so better then urs aytomatically) now if You
may find y? multiplication/Devision is more efficient then
Plus/minus then Do Googling.
have a good day
| Is This Answer Correct ? | 7 Yes | 12 No |
Post New Answer View All Answers
How to set on/off a group of indicators in a single statement?
You are given a dictionary of all valid words. You have the following 3 operations permitted on a word: delete a character, insert a character, replace a character. Now given two words - word1 and word2 - find the minimum number of steps required to convert word1 to word2. (one operation counts as 1 step.)
1. Write a program to create a sentence at runtime and count number of vowels in it ? 2. Write a program to get a string and to convert the 1st letter of it to uppercase ?
what is client server & server? What r types of Joins? explsin it! which types of indexex in sql server? what is triggers?
how many types of operating system are avaliable?
why not instantiating servet using new operator?
Explain what is OOPS and its concepts?
how do find the user exit for selected feild whatis the process and can u plz explain it
I need source code for Enrollment System using Visual Basic 6.0/2008 database MS Access 2007 for my school thesis project...please help me..kindly send in my email jpinedamcp@gmail.com
how CLR identify vb file?
I m new to the dbms. Recently i came across words clustered indexes & nonclustered indexes but i dont know what is this all about & whats the difference between them.. So please help me!!!!!!!!
iam confused among testing ,.net and java. can anybody help me.
how sap is different from other software ?
what is difference between kpo and it industry? that is in terms of work, package etc
WHat is execution in manual testing and when will we start execution and what language we use in execution