Computer Science, asked by markandeypandey4554, 7 months ago

Question - 8
Write a program to input two angles. Calculate and display whether they are "Complementary
Angles' or 'Supplementary Angles'. If they are Complementary then calculate Sine values of the
angles otherwise, Cosine (if supplementary) as per the user's choice​

Answers

Answered by shreyapra7635
3

Answer:

Dear ,

import java.util.*;

class supp_comp

{

public static void main()

{

Scanner S=new Scanner(System.in);

int a,b;

System.out.println("Enter the 2 angles");

a=S.nextInt();

b=S.nextInt();

int c=a+b;

if(c==180)

System.out.println("The angles are supplementary");

else if(c==90)

System.out.println("The angles are complementary");

else

System.out.println("The angles are neither supplementary nor complementary");

Similar questions