Write :
A Program to input 3 angles and check whether they form a triangle or not.
If yes print the type of triangle.
Answers
Answered by
3
import java.util.*
class angles
{
public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
System.out.println("Enter the three angles")
int a=sc.nextInt();
int b=sc.nextInt();
int c=sc.nextInt();
if(a+b+c==180)
System.out.println("triangle");
else
System.out.println("not a triangle");
}
}
class angles
{
public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
System.out.println("Enter the three angles")
int a=sc.nextInt();
int b=sc.nextInt();
int c=sc.nextInt();
if(a+b+c==180)
System.out.println("triangle");
else
System.out.println("not a triangle");
}
}
aakarsh09:
follow me if you liked my answer
Similar questions