1. Write a function to swap two values ?
$a = 10;
$b = 20;
echo $a, $b;
swap(); // If u want u can pass parameters
echo $a, $b; // It should print 20 , 10
Answer Posted / sangita jain
<?php function swap(){
$a=10;
$b=20;
$b=$b-$a;
$a=$a+$b;
echo $a,$b;
}
swap();
?>
| Is This Answer Correct ? | 0 Yes | 2 No |
Post New Answer View All Answers
What is full form of PHP?
What is laracast?
What are php keywords?
Can we override static method?
Why should I learn php?
What is use of in_array() function in php?
How check submit button is clicked in php?
What beforeFilter() is used?
Describe PHP error and logging information?
What is the difference between laravel and php?
Do you know when sessions ends?
What is php and why we use it?
What is abstract class in php?
How to update memcached when you make changes to php?
Where can I learn php?