Computer Science, asked by kumarirupam57294, 4 months ago


Write a program in BASIC 256 to find the squares of numbers less than
1000.​

Answers

Answered by Anonymous
7

\huge\red{answer} as I had never heard of Basic-256 before. So, I just downloaded it and what I wrote for square root of a number is my second program. In other words, this program works, but I am a novice and specifically disclaim any expertise in this particular variant of BASIC.

  • Print "Give me a positive number"  
  • Input x  
  • Dim a(100)  
  • a[0]=x  
  • for n=1 to 10  
  • a[n]=.5*(a[n-1]+x/a[n-1])  
  • print n; " "; a[n]  
  • next n

\huge\orange{@alurringbabe}

Answered by allysia
1

Language:

BASIC-256

Program:

for a= 1 to  999

print a^2

next a

Output:

1.0

4.0

9.0

16.0

25.0

.

.

.

998001.0

Explanation:

  • Line 1: Runs a loop from 1 to 999.
  • Line 2: returns the squared value.

Attachments:
Similar questions