write a java program to accept two angles calculate and display whether they are complementary angles or supplementary angles
Answers
Answered by
2
import java.util.*;
public class angles
{
public static void main(String args[])
{
Scanner in=new Scanner(System.in);
int an
if(an<=90)
System.out.println("Angle is complementry");
else
System.out.println("Angle is supplementry");
}
}
public class angles
{
public static void main(String args[])
{
Scanner in=new Scanner(System.in);
int an
if(an<=90)
System.out.println("Angle is complementry");
else
System.out.println("Angle is supplementry");
}
}
Answered by
18
___________________________________
★ Complementary angles are the two angles with a sum of 90°
★ Supplementary angles are the two angles with a s um of 180°
____________________
import java.util.*;
class angles
{
public static void main(String args[])
{
int a1 , a2, sum =0;
Scanner sc = new Scanner (System .in);
System.out.println("Enter both angles");
a1= sc.nextInt();
a2=sc.nextInt();
sum = a1 + a2;
if( sum ==90°)
{
System.out.println("Angels are complementary");
}
else if (sum ==180)
{
System.out.println("Angles aresupplementary");
}
else
{
System.out.println("They are neither complementary nor supplementary");
}
}
}
____________________________________
Similar questions
Science,
8 months ago
Science,
8 months ago
Biology,
8 months ago
Social Sciences,
1 year ago
Science,
1 year ago
Social Sciences,
1 year ago