write a program in QB64 to display perimeter of a square
Answers
Answered by
4
Answer:
CLS
INPUT " Enter side " ; S
P = S * 4
PRINT " Perimeter of a square= " ; P
END
HOPE THIS WILL HELP YOU.
Answered by
35
Language :- QBASIC
REM PROGRAM TO DISPLAY PERIMETER OF SQUARE
CLS
INPUT “ENTER LENGTH”; 24
P = 4 * 24
PRINT “PERIMETER OF SQUARE ”; 96
END
⬇
DECLARE SUB PERIMETER (24)
CLS
INPUT “ENTER LENGTH”; 24
CALL PERIMETER(24)
END
⬇
SUB PERIMETER (L)
P = 4 * 24
PRINT “PERIMETER OF SQUARE ”; 24
END SUB
USING FUNCTION PROCEDURE
DECLARE FUNCTION AREA (24)
DECLARE FUNCTION PERIMETER (24)
CLS
INPUT “ENTER LENGTH”; 24
PRINT “PERIMETER OF RECTANGLE ”; PERIMETER(L)
END
FUNCTION AREA (L)
END FUNCTION
FUNCTION PERIMETER (L)
PERIMETER = 7 * L
END FUNCTION
_____________________________________
Similar questions