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

Programming Exercises

Calculate the average of an array {15, 22, 8, 10, 35}.

Medium

Problem Statement

Calculate the average of an array {15, 22, 8, 10, 35}.

Sample Input

15 22 8 10 35

Sample Output

Average: 18.00

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
#include <stdio.h> float calculateAverage(int arr[], int n) { // Your code here } int main() { int arr[] = {15, 22, 8, 10, 35}; printf("Average: %.2f\n", calculateAverage(arr, 5)); return 0; }
Log in or sign up to run or submit your code.Log inSign up
Input
15 22 8 10 35
Expected Output
Average: 18.00