Computer Science, asked by honeyajeesh2017, 8 months ago

write a program to print sum of cubes of a given number between the range 1 to 10​

Answers

Answered by luisecubero77
2

Answer:

I used Pseint

Explanation:

Algoritmo Cubes

number,sum,cont Es Entero

imprimir "Input number between 1 and 10"

leer number

cont=1

sum=0

si number >=1 y number <= 10

 Mientras cont <= number

  sum=sum+cont^3

  imprimir cont^3

  cont=cont+1

 FinMientras

 imprimir "The sum is:",sum

SiNo

 imprimir "Error not number between 1 and 10"

FinSi

 

FinAlgoritmo

Algorithm Cubes

number, sum, cont Is Integer

print "Enter number between 1 and 10"

read number

cont = 1

sum = 0

if number> = 1 and number <= 10

  while cont <= number

        sum = sum + cont ^ 3

        print cont ^ 3

        cont = cont + 1

  endwhile

  print "The sum is:", sum

else

print "Error does not number between 1 and 10"

endif

End Algorithm

Attachments:
Similar questions