Computer Science, asked by subashtimalsina, 1 month ago

Write a QBASIC program to calculate the perimeter of a circle

Answers

Answered by Anonymous
1

Answer:

Explanation:

REM PROGRAM TO DISPLAY AREA AND CIRCUMFERENCE OF CIRCLE. CLS INPUT “ENTER RADIUS ”; R A= 3.14 * R ^ 2 C = 2 * 3.14 * R PRINT “AREA OF ...

Answered by Jasleen0599
1

A QBASIC program to calculate the perimeter of a circle

DECLARE SUB CIRCUM (R)

CLS

INPUT “ENTER RADIUS”; R

CALL CIRCUM (R)

END

SUB CIRCUM (R)

C = 2 * 3.14 * R

PRINT “CIRCUMFERENCE OF CIRCLE ”; C

END SUB

  • It is a well-known fact that the circumference to diameter ratio of a circle has a fixed value, 3.14159, which is symbolically expressed as. As a result, radius = 2 * diameter * circumference.
  • We must sum up the lengths of the rectangle's four sides in order to get its perimeter. Since there are two of each side length, it is easy to accomplish this by simply adding the length and width and multiplying the result by two. The perimeter formula is defined as perimeter=(length + width)2.

#SPJ2

Similar questions