SOLUTION: Write a PHP program to swap two variables.
The output should be like:
The number before swapping is: Number a=15 and b=27
The number after swapping is: Number a=27 and b=15
Algebra.Com
Question 1183006: Write a PHP program to swap two variables.
The output should be like:
The number before swapping is: Number a=15 and b=27
The number after swapping is: Number a=27 and b=15
I used this :
$a = 15;
$b = 27;
echo "\nThe Number before swapping is:\n";
echo "Number a = ".$a." and b = ".$b."\n";
$temp = $a;
$a = $b;
$b = $temp;
echo "\nThe number after swapping is: \n";
echo "Number a = ".$a." and b = ".$b."\n";
?>
But cannot figure how to get the lines separated comes out as one solid row vs the way I inputted above a row for each statement.
Thank You
Answer by ikleyn(52781) (Show Source): You can put this solution on YOUR website!
.
At this forum, we do not help in writing any computer programs.
RELATED QUESTIONS
The government would like to conduct a subsidy program for the lowest 5 percent of the... (answered by Theo)
2. Indicate which of the following are valid type int , double , or char constants in C... (answered by ikleyn)
a review program costs Php 9665 and an advancement program costs Php 8000. the number of... (answered by ikleyn,greenestamps)
1. You are buying two types of chocolate at the sari-sari store. Each chocolate A costs 4 (answered by ikleyn)
The digits of a two digit number sum to 10. If the digits swap places the number is 36... (answered by Edwin McCravy)
Please help me I really need this thank you
Answer the given problem.
1. It costs a... (answered by Theo)
The manager of a factory has found the output at the factory can be modeled by the... (answered by scott8148)
I am completely clueless to even where I begin. Please help!
Solve: George Lucas... (answered by solver91311)
Consider a perfectly competitive firm charging a price of P for each unit of output it... (answered by textot)