c++ program to find average of five numbers using arrays
Answers
Answered by
0
Answer:
C++ Program to Find Average of Numbers Using Arrays
Declare an integer variable 'sum' and initialize it to 0.
Using for loop, we will traverse inputArray from array index 0 to N-1.
For any index i (0<= i <= N-1), add the value of element at index i to sum
After termination of for loop, sum will contain the sum of all array elements.
Now calculate average = sum/N;
Similar questions