Back to all tasks

Array Summation Function

Your task is to complete the calculate_sum subroutine in Perl. This subroutine should accept a list of numbers as arguments and return their total sum. The provided starter code has an incomplete loop and an incorrect summation logic. You need to fix these issues to ensure the function correctly sums all elements in the input array.

array_summation_function.txt
Loading...

Use the "Verify Solution" button to get AI feedback on your perl code.