PHP in HindiProgramming Language

Exchange Value Without Using Third Value

Program:- Exchange Value Without Using Third Value, How to swap two numbers without using a temporary variable, Write a C program to swap two numbers without using 3rd variable, How to swap two numbers without using temporary variable?, How to swap without a third variable?

Solution – Exchange Value Without Using Third Value

<?php
$a = 'Hindi';
$b = 'Alerts';
list($a, $b) = array($b, &b);
//now $a is Alerts or $b is Hindi
?>

 

Related Articles

Leave a Reply

Your email address will not be published.

Back to top button
Close