write a java program to accept two angles calculate and display whether they are complementary angles or supplementary angles
Answers
Answered by
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
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
15
Heres the answer of your
question
Attachments:
Similar questions
Math,
8 months ago
English,
8 months ago
English,
8 months ago
Political Science,
1 year ago
Biology,
1 year ago