158k views
0 votes
Write a BASIC program that will calculate the square root of all numbers from 20 to 64​

User Jeenyus
by
7.5k points

1 Answer

5 votes

Here's an example of a BASIC program that calculates the square root of numbers from 20 to 64:

10 FOR I = 20 TO 64

20 S = SQR(I)

30 PRINT "The square root of "; I; " is "; S

40 NEXT I

This program uses a FOR loop to iterate through the numbers from 20 to 64. For each number, it calculates the square root using the SQR function and then prints out the result using the PRINT statement. The program uses a variable S to store the square root value.

User Buzut
by
8.4k points

No related questions found