How to swap the two integers or real numbers without using the third variable in the php language
ADVERTISEMENTS
How to swap the two integers or real numbers without using the third variable in the php language. In this whole program, you will learn how to determine the swapping of two integers or real numbers without using the third variable in the php language.
Take an example to understand this a php program:
<?php
// How to swap the two integers or real numbers
// without using the third variable in the PHP language
$p = 8;
$q = 9;
$p = $p - $q;
$q = $p + $q;
$p = $q - $p;
echo "After swapping, p = " . $q . "\n";
echo "After swapping, q = " . $p;
?>
Output:
After swapping, p = 8
After swapping, q = 9
Tags:
# how to swapping of two numbers without using the third variable in php language
# make a php program to swap two numbers using the function
# make a php program to swap two numbers without using a third variable using the function