Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Find the sum of all even numbers in an array {4, 7, 10, 13, 18}.

Medium

Problem Statement

Find the sum of all even numbers in an array {4, 7, 10, 13, 18}.

Sample Input

4 7 10 13 18

Sample Output

Sum of even numbers: 32

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
#include <stdio.h> int sumEvenNumbers(int arr[], int n) { // Your code here } int main() { int arr[] = {4, 7, 10, 13, 18}; printf("Sum of even numbers: %d\n", sumEvenNumbers(arr, 5)); return 0; }
Log in or sign up to run or submit your code.Log inSign up
Input
4 7 10 13 18
Expected Output
Sum of even numbers: 32