codinasion icon indicating copy to clipboard operation
codinasion copied to clipboard

Write a Kotlin program to find average of numbers by recursion

Open harshraj8843 opened this issue 2 years ago • 1 comments

Description

Write a Kotlin program to find average of numbers by recursion

Average of numbers is the sum of all numbers divided by the number of numbers. For example, the average of 1, 2, 3, 4, 5 is 3. The average of 1, 2, 3, 4, 5, 6 is 3.5.

Average of numbers can be calculated by recursion. The average of numbers is the sum of the first number and the average of the rest of the numbers. The average of the rest of the numbers is the sum of the second number and the average of the rest of the numbers. The average of the rest of the numbers is the sum of the third number and the average of the rest of the numbers. And so on.

Input  : 1 2 3 4 5
Output : 3
How to contribute
  • Save the solution in program/FindAverageOfNumbersByRecursion.kt file
  • Add FindAverageOfNumbersByRecursion.kt file in find-average-of-numbers-by-recursion folder

harshraj8843 avatar Oct 16 '22 12:10 harshraj8843

!assign

mrajesh09 avatar Oct 30 '22 00:10 mrajesh09