IF statement _ problem !!!
Hi everyone,
can anyone tell me what is wrong with the following statement :
if ( (side1 * side1) + (side2 * side2) = (hypotenuse * hypotenuse) ) {
output.append(side1 + "\t" + side2 + "\t" + hypotenuse + "\n");
}
It says : Invalid left hand side of assignment. Arrow pointed at sign + .
Thanks a lot,Isaac.
[364 byte] By [
IsaacR] at [2007-9-26 1:54:13]

> if ( (side1 * side1) + (side2 * side2) = (hypotenuse *
> hypotenuse) ) {
> output.append(side1 + "\t" + side2 + "\t" +
> "\t" + hypotenuse + "\n");
> }
>
> It says : Invalid left hand side of assignment. Arrow
> pointed at sign + .
you should also use the open and close parenthesis so that the compiler will not get confused, such as this:
if ( ((side1 * side1) + (side2 * side2)) == (hypotenuse *
hypotenuse) )
and also like lichu said: use == instead of =.