Subject: PHP

Sum of Even Numbers

Write a PHP function to find the sum of all even numbers in an array.

Example:
Input: [1, 2, 3, 4, 5, 6]
Output: 12

Select file or drag and drop

PNG, JPG, SVG

Preview