Average of Array Problem

Average of Array Problem — ExecCode School DSA Practice

Solve the Average of Array problem on ExecCode. Free online school DSA practice in Arrays - Basics. Write and run code in Java, C++, Python — no signup required to run.

Problem description

You are given a whole number for the problem Average of Array. Your task is to you will first read how many numbers are in a list. Then, you will read the actual numbers in that list. Find the average of all these numbers by adding them up and dividing by how many there are. Print this average.

Examples

Input 3 1 2 3; Output 2.00. Input 5 10 20 30 40 50; Output 30.00

Constraints

1 <= N <= 1000 -10^5 <= Array Element <= 10^5

Practice Average of Array free on ExecCode. Browse DSA problems, topic map, and placement guides.