Program to find area and perimeter of a square – GW-BASIC Tutorials

Program to find area and perimeter of a square

[xyz-ihs snippet=”Google-Adsense”]

-Program:

10     REM Program to find area and perimeter of a square in GW-BASIC (BASIC)
20     INPUT “Enter length of side: ” ; L
30     AREA = L*L
40     PERI = 4*L
50     PRINT “Area of square: ” ; AREA
60     PRINT “Perimeter of square: ” ; PERI
70     END

[xyz-ihs snippet=”200-x-90″]

-Algorithm:

STEP 1 START
STEP 2 INPUT L
STEP 3 COMPUTE AREA = L*L
STEP 4 COMPUTE PERI = 4*L
STEP 5 PRINT AREA
STEP 6 PRINT PERI
STEP 7 END

[xyz-ihs snippet=”200-x-90″]

-Program & Output at GW-BASIC Emulator:

Program & output

Program & output

[xyz-ihs snippet=”200-x-90″]


“My posts/articles are not allowed to be stolen/copied anywhere at Cyber space. Doing so will allow me to take a legal action against the copier.”

Related Posts

Leave a Comment

Kindly solve the following puzzle to prove that you\'re not a bot: