I need a program that will print a square and cubes table. It would like this:
Number Square Cube
1 1 1
Once you get the square, couldn't you get the cube by multiplying the number *square? Or do you have to do a cube?
It should also print out the sum of the squares, the sum of the cubes, how many cubes were greater than 500, a message stating whether or not the sum of the squares exceeded 2,000.
Shouldn't it go something like this?
var i, number, square, cube, sumsquare, sumcube: integer;
for i := 1 to 15 do
square := i * i;
cube:= number * square;
I don't know how to align it.
You would do the sum of the square and cubes like this?
for i:= 1 to 15 do
sum := i*i + i;
writeln('sum of squares is ', sum)
if sumsquares > 2,000 then
writeln('Sum of squares was over 2,000 ')
for I:= 1 to 15 do
sum:= number * square + 1;
writeln('sum of cubes is ', sum)
I don't how do this all in one program.
I wouldn' know about the greater than part