Computer Science, asked by jkumari97975, 6 months ago

write a program in QB64 to display perimeter of a square​

Answers

Answered by AnishaBid
4

Answer:

CLS

INPUT " Enter side " ; S

P = S * 4

PRINT " Perimeter of a square= " ; P

END

HOPE THIS WILL HELP YOU.

Answered by ıtʑFᴇᴇʟɓᴇãᴛ
35

\mathtt{\huge{\underline{\red{Programme:-}}}}

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

\mathtt{\huge{\underline{\green{Output:-}}}}

 \setlength{\unitlength}{0.25cm}\begin{picture}(5,5)\thicklines\multiput(0,0)(24,0){2}{\line(0,1){7}}\multiput(0,0)(0,7){2}{\line(1,0){24}}\put(10,-2){\sf{24\ cm}}\put(25,3){\sf{7\ cm}}\end{picture}

_____________________________________

Similar questions