Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is needed to be able to use image function?

1012


Who is the father of php and what is the current version of php and mysql?

1326


What does the unlink() function means?

1097


What are the advantages of oops in php?

1079


Is php still used?

955


What is cookie and why do we use it?

984


How can we enable error reporting in php?

1042


What is php stack?

961


Why and where do we use htaccess?

1038


What is a substring in php?

1071


How to reset/destroy a cookie in php?

968


How break and continue while loop in php?

952


What does a delimiter do in mysql?

1060


Differentiate between require and include?

970


How to convert one date format into another in php?

913