Saturday 6 June 2020

Write a sub program to print area of a cylinder, radius and height of cylinder are given by the user in main module and pass them as parameter list when sub program is called.

Answer:
DECLARE SUB cyl(r, h)
CLS
           INPUT "Enter a radius"; r
           INPUT "Enter a height"; h
CALL cyl(r, h)
END
SUB Triangle
           LET Area = (22/7)*r^2*h
           PRINT "Area of triangle is", Area
END SUB

No comments:

Post a Comment

MCQ Question Bank Microsoft PowerPoint