Computer Science, asked by aumgupta33, 11 months ago

write a program to input three sides of a triangle and check whether the triangle is possible or not??​

Answers

Answered by unknown404user
1

Answer:

a=eval(input("enter 1st angle"))

b=eval(input("enter 2nd angle"))

c=eval(input("enter 3rd as angle"))

abc=a+b+c

if(abc=180):

print("triangle is possible")

else:

print("triangle is not possible")

hope it helped u

Answered by SanjanaShetty06
1

Answer:

// a program to display the three type of triangle

import java. io. *;

public class Triangle

{

public static void main (String args[])throws IOException

{

InputStreamReader read = new InputStreamReader(System.in) ;

BufferedReader in = new BufferedReader(read) ;

int a, b, c;

System.out.println("Enter three sides of a triangle") ;

a=Integer.parselnt(in.readLine()) ;

b=Integer.parselnt(in.readLine()) ;

c=Integer.parselnt(in.readLind()) ;

if((a+b>c) &&(b+c>a) &&(c+a>b))

{

System.out.println("Triangle is possible ") ;

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

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

else if ((a==b) | | (b==c) | | (c==a))

System.out.println(" Isosceles triangle ") ;

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

System. out. println(" Scalene triangle");

}

else

System.out.println("Triangle not possible") ;

}

}

Hope it helps you......

Similar questions