Computer Science, asked by Pranavbhat16, 1 year ago

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 aakarsh09
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");
}
}

aakarsh09: follow me if you liked my answer
Pranavbhat16: sure
Similar questions