Computer Science, asked by aasu7, 1 year ago

enter the sides of a triangle and check whether the triangle is possible or not using I/O statement

Answers

Answered by Monika010
3
import java.io.*;
class triangle
{
public static void main (String args[]) throws IOException
{
InputStreamReader read = new Inputstreamreader (System.in);
BufferedReader read = new BufferedReader (read);
System.out.println (" Enter the sides of a triangle");
int a,b,c;
a = Integer.parseInteger(in.readline);
b = Integer.parseInteger(in.readline);
c= Integer.parseInteger(in.readline);

if ((a+b>c)&&(b+c>a)&&(c+a>b))
System.out.println("Triangle is possible");
else
System.out.println("Triangle is not possible");
}
}
Similar questions