Computer Science, asked by parasgoyal0201, 1 year ago

Enter three sides of a triangle and check if it is an equilateral triangle or not

Plz done it in JAVA format

Answers

Answered by medhakrishnabehera
0
import java.util.*;
public class triangle
{
public static void main()
{
Scanner scn=newScanner(System.in);
System.out.println("enter the three sides");
int a=scn.nextInt();
int b=scn.nextInt();
int c=scn.nextInt();
if (a==b && b==c && c==a)
System.out.println("it is a equilateral triangle having equal sides");
else
System.out.println("it is not a equilateral triangle");
}
}


medhakrishnabehera: plz mark as brainliest
Answered by anindyaadhikari13
1

Question:-

Write a Java program to input 3 sides of a triangle and check whether it is an equilateral triangle or not.

Program:-

import java.util.*;

class Triangle

{

public static void main(String args[])

{

Scanner sc=new Scanner(System.in);

System.out.println("Enter 3 sides. ");

int a=sc.nextInt();

int b=sc.nextInt();

int c=sc.nextInt();

if(a==b && b==c)

System.out.println("Equilateral Triangle. ");

else

System.out.println("Not an Equilateral Triangle.");

}

}

Similar questions