QBasic Programming

Display area of square

REM PROGRAM TO DISPLAY AREA OF SQUARE
CLS
INPUT “ENTER LENGTH”; L
A = L ^ 2
PRINT “AREA OF SQUARE ”; A
END

USING SUB PROCEDURE

DECLARE SUB AREA (L)
CLS
INPUT “ENTER LENGTH”; L
CALL AREA(L)
END

SUB AREA (L)
A = L ^ 2
PRINT “AREA OF SQUARE”; A
END SUB

USING FUNCTION PROCEDURE

DECLARE FUNCTION AREA (L)
CLS
INPUT “ENTER LENGTH”; L
AR = AREA(L)
PRINT “AREA OF SQUARE ”; AR
END

FUNCTION AREA (L)
A = L ^ 2
AREA = A
END FUNCTION

Display area of rectangle (Prev Lesson)
(Next Lesson) Display area of circle
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 !!