QBasic Programming

Display area of triangle

REM PROGRAM TO DISPLAY AREA OF TRIANGLE
CLS
INPUT “ENTER BREADTH”; B
INPUT “ENTER HEIGHT”; H
A = 1 / 2  * (B * H)
PRINT “AREA OF TRIANGLE “; A
END

USING SUB PROCEDURE

DECLARE SUB AREA (B, H)
CLS
INPUT “ENTER BREADTH”; B
INPUT “ENTER HEIGHT”; H
CALL AREA (B, H)
END

SUB AREA (B, H)
A = 1 / 2  * (B * H)
PRINT “AREA OF TRIANGLE”; A
END SUB

USING FUNCTION PROCEDURE

DECLARE FUNCTION AREA (B, H)
CLS
INPUT “ENTER BREADTH”; B
INPUT “ENTER HEIGHT”; H
AR = AREA( B, H)
PRINT “AREA OF TRIANGLE ”; AR
END

FUNCTION AREA (B, H)
A = 1 / 2 * (B * H)
AREA = A
END FUNCTION

Display area of 4 walls (Prev Lesson)
(Next Lesson) Display area of parallelogram
Back to QBasic Programming
Notice: compact(): Undefined variable: limits in /home/bhimgautam34/public_html/wp-includes/class-wp-comment-query.php on line 853

Notice: compact(): Undefined variable: groupby in /home/bhimgautam34/public_html/wp-includes/class-wp-comment-query.php on line 853

No Comments

Post a Reply

Course Curriculum

error: Content is protected !!