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 needed to be able to use image function?
Who is the father of php and what is the current version of php and mysql?
What does the unlink() function means?
What are the advantages of oops in php?
Is php still used?
What is cookie and why do we use it?
How can we enable error reporting in php?
What is php stack?
Why and where do we use htaccess?
What is a substring in php?
How to reset/destroy a cookie in php?
How break and continue while loop in php?
What does a delimiter do in mysql?
Differentiate between require and include?
How to convert one date format into another in php?