Computer Science, asked by mayuksarkar05, 6 months ago

Write a program to accept the measure of two angles and check if they are complementary. in basic pograming

Answers

Answered by udayagrawal49
20

Answer: The required java program is :-

import java.util.Scanner;

public class Main {

public static void main(String[] args) {

    Scanner scan = new Scanner(System.in);

    System.out.print("Enter the value of first angle (in degree) : ");

    double angle1 = scan.nextDouble();

    System.out.print("Enter the value of first angle (in degree) : ");

    double angle2 = scan.nextDouble();

    scan.close();

    double sum = angle1+angle2;

    if(sum == 180.0) {

        System.out.println("The angles "+angle1+" and "+angle2+" are complementary angles.");

    }

    else {

        System.out.println("The angles "+angle1+" and "+angle2+" are not complementary angles.");

    }

   }

}

Please mark it as Brainliest.

Similar questions