Computer Science, asked by AktfathGkgour, 1 year ago

write a java program to accept two angles calculate and display whether they are complementary angles or supplementary angles

Answers

Answered by Lord007Thopalli
33
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");
}
}
//use this code in blueJ

Answered by Tamatar
15

Heres the answer of your

question



Attachments:
Similar questions