QBASIC PROGRAM TO FIND PERIMETER OF RECTANGLE
CLS
INPUT “ENTER LENGTH”; L
INPUT “ENTER BREADTH”; B
P = 2 * (L + B)
PRINT “PERIMETER OF RECTANGLE ”; P
END
USING SUB
DECLARE SUB PER(L,B)
CLS
INPUT “ENTER LENGTH”; L
INPUT “ENTER BREADTH”; B
CALL PER(L,B)
END
SUB PER(L,B)
P = 2 * (L + B)
PRINT “PERIMETER OF RECTANGLE ”; P
END SUB
0 Comments