Computer Science, asked by abhijitvalmigan, 3 months ago

write a java program To check whether the triangle is possible or not

Answers

Answered by atrs7391
1

/*

Project Type: Brainly Answer

Date Created: 11-02-2021

Date Edited Last Time: ---NIL---

Question Link: https://brainly.in/question/34997025

Question: Write a java program, to check whether the triangle is possible or not.

Program Created By: atrs7391

Programming Language: Java

Language version (When program created or last edited): jdk-15.0.2

*/

package Brainly_Answers;

import java.util.Scanner;

public class Triangle_Check {

   public static void main(String[] args) {

       Scanner sc = new Scanner (System.in);

       System.out.println("Enter angle 1: ");

       int a1 = sc.nextInt();

       System.out.println("Enter angle 2: ");

       int a2 = sc.nextInt();

       System.out.println("Enter angle 3: ");

       int a3 = sc.nextInt();

       int fa = a1+a2+a3;

       if (fa<=180) {

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

       }

       else {

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

       }

   }

}

Similar questions