Cody

Problem 44035. determine the sum of the squares

Solution 2549109

Submitted on 14 Jun 2020 by Ramesh Kumar V
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
x = 4; y = 30; assert(isequal(sum_square(x),y))

x = 1 2 3 4 sum = 1 sum = 5 sum = 14 sum = 30

2   Pass
x = 6; y = 91; assert(isequal(sum_square(x),y))

x = 1 2 3 4 5 6 sum = 1 sum = 5 sum = 14 sum = 30 sum = 55 sum = 91

3   Pass
x = 5; y = 55; assert(isequal(sum_square(x),y))

x = 1 2 3 4 5 sum = 1 sum = 5 sum = 14 sum = 30 sum = 55

4   Pass
x = 15; y = 1240; assert(isequal(sum_square(x),y))

x = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 sum = 1 sum = 5 sum = 14 sum = 30 sum = 55 sum = 91 sum = 140 sum = 204 sum = 285 sum = 385 sum = 506 sum = 650 sum = 819 sum = 1015 sum = 1240

Suggested Problems

More from this Author4

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!