Quote:

import java.util.Scanner;

public class triangle {

public static void main(String[] args) {

double sidea;

double sideb;

double sidec;

Scanner in = new Scanner(System.in);

System.out.println("Enter the first side of a triangle: ");

sidea = in.nextDouble();

System.out.println("Enter the second side of a triangle: ");

sideb = in.nextDouble();

System.out.println("Enter the third side of a triangle: ");

sidec = in.nextDouble();

System.out.println("Sides" + " " + sidea + " " + sideb + " " + sidec);

if (((sidea * sidea) + (sideb * sideb)) == (sidec * sidec))

System.out.println("right triangle");

if (((sidea * sidea) + (sidec * sidec)) == (sideb * sideb))

System.out.println("right triangle");

if (((sidec * sidec) + (sideb * sideb)) == (sidea * sidea))

System.out.println("right triangle");

//right triangle

if ((sidea == sideb) && (sidea == sidec) && (sideb == sidec))

System.out.println("equilateral triangle");

//equilateral triangle

if (((sidea == sideb) || (sideb == sidec) || (sidea == sidec)) && !((sidea == sideb) && (sidea == sidec) && (sideb == sidec)))

System.out.println("isosceles triangle");

else (!((sidea == sideb) && (sidea == sidec) && (sideb == sidec)))

System.out.println("scalene triangle");

//scalene

if (((sidea + sideb) >= (sidec)) ||((sidea + sideb) >= (sideb)) ||((sideb +sidec) >= (sidea)))

System.out.println("not a triangle");

}

}

Quote:

Error:

F:\JCreatorV4\MyProjects\triangle\src\triangle.jav a:53: not a statement

else (!((sidea == sideb) && (sidea == sidec) && (sideb == sidec)))

^

F:\JCreatorV4\MyProjects\triangle\src\triangle.jav a:53: ';' expected

else (!((sidea == sideb) && (sidea == sidec) && (sideb == sidec)))

^

2 errors

Process completed.