Computer Science, asked by renekitson5203, 6 months ago

Write a QBASIC program to find the perimeter of squares using for next loop. The loop shall end if the side of the square entered by use is negative.

Answers

Answered by anindyaadhikari13
1

Question:-

  • Write a QBASIC program to find the perimeter of squares using for next loop. The loop shall end if the side of the square entered by use is negative.

Program:-

This is the required program.

CLS

FOR I=1 TO 4 STEP -1

INPUT "Enter the side length: ";S

IF S<0 THEN

END

END IF

P=4*S

PRINT "Perimeter is: ";P

NEXT I

END

Similar questions