answersLogoWhite

0

C:

#include

int main()

{

int num,sum,avg=0,i;

printf("enter a number");

scanf("%d",&num);

for(i=0;i<=num;i++)

{

sum+=i;

avg = sum/num;

printf("%d",avg);

}}

Visual Basic:

Private Function CalculateAverage (ByVal intArray As Integer()) As Integer

Dim intNumber As Double

For i = 0 to intArray.Length - 1

intNumber = intNumber + intArray(i)

End For

intNumber = intNumber / intArray.Count

Return intNumber

End Function

User Avatar

Wiki User

14y ago

Still curious? Ask our experts.

Chat with our AI personalities

MaxineMaxine
I respect you enough to keep it real.
Chat with Maxine
TaigaTaiga
Every great hero faces trials, and you—yes, YOU—are no exception!
Chat with Taiga
CoachCoach
Success isn't just about winning—it's about vision, patience, and playing the long game.
Chat with Coach
More answers

Write program in C++ to find summation of 3 integer number and find the average

User Avatar

Anonymous

4y ago
User Avatar

Add your answer:

Earn +20 pts
Q: Write a program to calculate the average of n numbers using array?
Write your answer...
Submit
Still have questions?
magnify glass
imp