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 / ranjan

function swap(){

$a = 10;
$b = 20;

$a = $a + $b;
$b = $a - $b;
$a = $a - $b;
echo $a, $b;

}

Is This Answer Correct ?    45 Yes 25 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which php framework is best for security?

1066


Which cryptographic extension provide generation and verification of digital signatures?

987


Explain what is the difference between for and foreach?

1124


What is the difference between get and post in php?

1079


Can we use php variable in javascript?

1065


Explain about a search-friendly site looks like?

900


What is null value in php?

1101


What does the scope of variables mean?

1007


What is memcache?

1024


Is a number php?

1042


Which will check if a function exists?

1129


How to send email using php script?

1097


How many types of errors in php?

1118


What is the purpose of the '.myi' file extension? What do thes file contain?

1027


How to make a class in php?

1022