364,280 views
22 votes
22 votes
Write a program to enter RADIUS of a CIRCLE and PRINT AREA of TRIANGLE using Q Basic. (class 8)​

User Roy Levy
by
2.7k points

1 Answer

20 votes
20 votes

Answer:

The program is as follows:

10 INPUT RADIUS, BASE, HEIGHT

20 CIRCLE = 3.142* RADIUS * RADIUS

30 TRIANGLE = 0.5* BASE * HEIGHT

40 PRINT CIRCLE

50 PRINT TRIANGLE

60 STOP

Step-by-step explanation:

The program description doesn't tally;

In other words, it is impossible to calculate the area of a triangle using the radius of a circle.

So, I designed the program to get input for radius, base and height.

Get input for radius, base and height

10 INPUT RADIUS, BASE, HEIGHT

Calculate area of circle

20 CIRCLE = 3.142* RADIUS * RADIUS

Calculate area of triangle

30 TRIANGLE = 0.5* BASE * HEIGHT

Print area of circle

40 PRINT CIRCLE

Print area of triangle

50 PRINT TRIANGLE

End of program

60 STOP

User Chidi
by
3.2k points