Computer Science, asked by banama4t9kpran, 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 Eeluhaluzalu
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");
}
}
Answered by muakanshakya
18
\Huge\textbf{\underline{\underline{Answer;}}}

___________________________________

★ 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");

}

}
}

____________________________________

\Huge\textbf{\underline{\underline{Thanks :)}}}
Similar questions