Cody

Problem 2274. Find the square of the sum of the digits of a number

Solution 463900

Submitted on 29 Jun 2014 by RA
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 = 35431; y_correct = 256; assert(isequal(sq_sum(x),y_correct))

y = 256

2   Pass
%% x = -431; y_correct = 64; assert(isequal(sq_sum(x),y_correct))

y = 64

Suggested Problems

More from this Author9

Community Treasure Hunt

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

Start Hunting!