QBASIC Program To Find The Perimeter Of Rectangle

 QBASIC Program To Find  The Perimeter Of Rectangle

QBASIC Program To Find  The Perimeter Of Rectangle


QBASIC Program To Find  The Perimeter of a rectangle

CLS
INPUT “Enter length of the rectangle ”; L
INPUT “Enter breadth of the rectangle”; B
P = 2*(L + B)
PRINT “Perimeter of the rectangle ”; P
END


QBASIC Program To Find The Perimeter of a rectangle using Sub Procedure


DECLARE SUB  Perimeter (L, B)
CLS
INPUT “Enter length of the rectangle ”; L
INPUT “Enter breadth of the rectangle”; B
CALL Perimeter(L, B)
END

SUB Perimeter (L, B)
P =2*( L + B)
PRINT “The perimeter of the rectangle is ”; P
END SUB


QBASIC Program To Find The Perimeter of a rectangle  using Function Procedure


DECLARE FUNCTION Perimeter (L, B)
CLS
INPUT “Enter length of the rectangle ”; L
INPUT “Enter breadth of the rectangle”; B
PRINT “The perimeter of the rectangle ”; Perimeter(L, B)
END

FUNCTION Perimeter (L, B)
P =2*( L + B)
Perimeter=P
END FUNCTION

Comments