1. Engineering
  2. Computer Science
  3. given a variable n refers to a positive int value...

Question: given a variable n refers to a positive int value...

Question details

Given a variable n refers to a positive int value, use two additional variables, k and total to write a for loop to compute the sum of the cubes of the first n counting numbers, and store this value in total. Thus your code should put 1°1*1 + 2*2*2 + 33.3 + + n.n.n into total. Use no variables other than n, k, and total. Submit History: X (1 of 1) 01/24/19 07:49:35 ▼ 1 k 2 total 0 3 for k in range (n+1): 4 total-total +kkk

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution