How to swap values between two variables without using a
third variable?
Answer Posted / sriram
Hey guys, what about swaping variables contains string
values? All of your solutions will suck... Try this and swap
any datatype without third variable... Happy Sensible Coding..
$v = 'sriram';
$u = 'lakshmi';
$v .= $u;
$u = substr($v,0,(strlen($v) - strlen($u)));
$v = substr($v,(strlen($v) - strlen($u)-1), strlen($v));
echo 'u = ' . $u .'<br>';
echo 'v = ' . $v;
| Is This Answer Correct ? | 8 Yes | 4 No |
Post New Answer View All Answers
What is WEB 3.0? What are the features their in WEB3.0
design a counter with the following repeated binary sequence: 0, 1, 2, 3, 4, 5, 6, 7, 8 using JK Flip Flop.
differences between qtp10.0 and 11.0 ?
Which CRM is better to opt, Sebiel CRM or Salesforce CRM or sap CRM? which institute is best one in hyderabad
1.Mutating table
iam confused to choose among testing, .net and java can anybody help me????????
When will you use shell script/Perl ahead of C/C++?
How will you prove that java swing is multithreaded?
what is the similarity between networking devices?
what is apt_dump_score in datastage where it is useful
In OB52 , How to define two open posting period, Like only 5 and 8 posting should be open.. should not open 6 and 7..period..
My Qualification is MCA.My interview is on 5th may.They may ask q as------AS u r MCA...Why u r not tring anywhere else? What can be the ans?
Explain with examples any 2 features of OOPS.
what is web configuration file
Write a pascal program to calculate the sum of the first 100 even number and odd number