Computer Science, asked by kakoleebiswas, 1 month ago

write a program to enter two angles and print weather they are complementry or soplimentry or nun​

Answers

Answered by Anonymous
1

The question is being answered by assuming that the user has asked it for python.

Required program :-

a = int(input ("Enter 1st angle: "))

b = int(input ("Enter 2nd angle: "))

if (a+b==90):

print ("They are complementary angles")

elif (a+b==180):

print ("They are supplementary angles ")

else:

print ("None")

Explanation :-

  • Firstly take input of two angles from the user in the integral form. To take input as integer, we use int() function.

  • Now use if else ladder to print whether the input angle is supplementary or complementary.

  • Supplementary angles are those whose sum is 180° and complementary angles are those whose sum is 90°.

  • If the required conditions doesn't satisfy in the if and elif condition, the program will print None as per according to the question.

Output attached . . .

Attachments:
Similar questions