Hi Im trying to do this simple code within a loop that does the following: Program to write: Write a program to do the algebraic equation x = a(b+6)/2 multiple times within loops that vary a and b. The variable a should start at 1 go to 10 and increment by 1. The variable b should start at 2 and go to 10 and increment by 2. When you display the answer show the formula in php. I want you to do this three times: once with a for...next, once with a do...while and once with a while. I think my logic is right but Im getting the error and I cant debug.
<html>
<head><title>DO WHILE</title></head>
<body>
<h2>Do While</h2>
<?php
$VarA = 1;
$VarB = 2;
$VarC = 6;
$VarD = 2;
$ctA = 1;
$ctB = 2;
$VarAns = 0;
$VarAns = ($VarA ($VarB+$VarC6) / $VarD);
do
{
$VarAns = ($VarA ($VarB+$VarC6) / $VarD);
print ("x = $VarA($VarB+6)/2 is equal to VarX<br>");
$ctA = $ctA + 1;
$ctB = $ctB + 2;
} while ($ctA <= 10 and $ctB <=10);
?>
</body>
</html>