Help with if else statements
Hi, I'm new to java. I'm taking a class at my university and my homework is to design a program which will calculate the area of a triangle using Heron's Formula. My instructor also wanted us to use an if else statement so if it is an invalid triangle the program would let the user know.
I'm not sure what's wrong with my program. I use eclipse, and it tells me "Syntax error on token "else", delete this token"
Any help is appreciated.
public class HerosFormula
public static void main(Stringargs)
System.out.println("Enter the three sides of the triangle to caluclate its area.");
int n1, n2, n3, n4;
Scanner keyboard = new Scanner(System.in);
n1 = keyboard.nextInt();
n2 = keyboard.nextInt();
n3 = keyboard.nextInt();
n4 = (n1 + n2 + n3)/2;
n5 = Math.sqrt(n4 * (n4-n1) * (n4-n2) * (n4-n3));
if ((n1>n2+n3) || (n2>n1+n3) || (n3>n1+n2) || (n1<n2-n3) || (n1<n3-n2) || (n2<n1-n3) || (n2<n3-n1) || (n3<n1-n2) || (n3<n2-n1));
System.out.println("The area of the the triangle is:");