//Programa que determine si un triangulo es equilatero, isosceles o escaleno.
package lab1ej2;
import java.util.Scanner;
public class Lab1ej2 {
public static void main(String[] args) {
Scanner entrada = new Scanner(System.in);
System.out.println("Digite el primer lado: ");
double a = entrada.nextDouble();
System.out.println("Digite el segundo lado: ");
double b = entrada.nextDouble();
System.out.println("Digite el tercer lado: ");
double c = entrada.nextDouble();
if(a == b && a== c && b==c)
System.out.println("Es equilatero");
else
if (a == b ||a == c || b == c)
System.out.println("Es isosceles");
else
System.out.println("Es escaleno");
}
}
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.