Q:

Mathematics trouble in if statement

Code:
import java.util.Scanner; 
public class testqu {

        public static void main(String[] args) { 
          Scanner console = new Scanner(System.in); 
          System.out.println("Enter the length of the first side of the triangle"); 
          double a = console.nextInt(); 
          System.out.println("Enter the length of the second side of the triangle"); 
          double b = console.nextInt(); 
          System.out.println("Enter the length of the third side of the triangle"); 
          double c = console.nextInt(); 

          if ((a*a) + (b*b) = (c*c))
            System.out.println("The triangle is a right triangle!");

} 
}

Assignment: 
In a right triangle, the square of the length of the longest side is equal to the sum of the squares of the lengths of the other two sides.  Write a program that prompts the user to enter the lengths of three sides of a triangle, and then outputs a message indicating whether the triangle is a right triangle or not.  The program is to work correctly regardless to the order in which the lengths of the 3 sides are input.
My problems: code doesn't compile, found: variable, required: value
Also: I have no idea how to make it so the program would know if the triangle was right even if the sides were not given in order. Please help, I am a beginner having a lot of trouble with this assignment.

A:

Use the comparison operator == to compare values, not the assignment operator =, which can't assign a value to a value, only to a variable.  Change
if ((a*a) + (b*b) = (c*c))

to
if ((a*a) + (b*b) == (c*c))

