6. Write a program to accept two angles. Calculate and display whether they are
"complementary angles" or "supplementary angles" as per the user's choice.
(Complementary angles sum of angles = 90°, Supplementary:- Sum of angle = 180°)
atrs7391:
programming language??
Answers
Answered by
2
Answer:
If you have any problem related to it ask me in the comments...
package com.company;
import java.util.Scanner;
public class Main {
public static void main(String[] args)
{
Scanner sc = new Scanner (System.in);
System.out.println("Enter angle 1: ");
double a1 = sc.nextDouble();
System.out.println("Enter angle 2: ");
double a2 = sc.nextDouble();
if (a1+a2==90) {
System.out.println("Supplementary angles");
}
else if (a1+a2==180) {
System.out.println("Complementary angles");
}
else {
System.out.println("Neither supplementary nor complementary angles");
}
}
}
Attachments:
Similar questions