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

EzraEzra
Faith is not about having all the answers, but learning to ask the right questions.
Chat with Ezra
MaxineMaxine
I respect you enough to keep it real.
Chat with Maxine
DevinDevin
I've poured enough drinks to know that people don't always want advice—they just want to talk.
Chat with Devin
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