2 WHILE X < 10 DO
3 A = X * X
4 OUTPUT X, A
5 X = X + 1
6 ENDWHILE
7 END
1For ( X=1; X<=10; X++)
2 A = X * X
4 Print A
5 End
For my computing homework I've been given this algorithm
1 X=1
2 WHILE X < 3 DO
3 A = X * X
4 OUTPUT X, A
5 X = X + 1
6 ENDWHILE
7 END
I need to rewrite the algorithm so that the new algorithm will print the numbers 1-10 with their squares.
Can anyone tell me how to do this as well as how to figure it out etc.