Write a java program to Input values of three angles of a quadrilateral. Check if quoduildenal con be formed on the basis of angles. If not, print proper messages and and end the program
Print category from which the
quadrilateral belongs :
(a)Square
(b) Rectangle
(0) Rhombus
(d) Parallelogocom
Le None of the Above
Answers
Answer:
mark me the brainiliest
The input values will be taken as a input. and hence, the output will be predicted.
Explanation:
import java.util.Scanner;
public class abc
{
public static void main(String args[])
{
Scanner in = new Scanner(System.in);
System.out.print("Enter first angle: ");
int a1 = in.nextInt();
System.out.print("Enter second angle: ");
int a2 = in.nextInt();
System.out.print("Enter third angle: ");
int a3 = in.nextInt();
int angleSum = a1 + a2 + a3;
if (angleSum == 180 && a1 > 0 && a2 > 0 && a3 > 0) {
if (a1 < 90 && a2 < 90 && a3 < 90) {
System.out.println("rectangle");
}
else if (a1 == 90 || a2 == 90 || a3 == 90) {
System.out.println("square");
}
else {
System.out.println("Rhombus");
}
}
else {
System.out.println("Parallelogocom");
}
}
}