answersLogoWhite

0


Best Answer

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

13y ago
This answer is:
User Avatar
More answers
User Avatar

Anonymous

Lvl 1
3y ago

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

This answer is:
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
Related questions

Could you Write a program for 8086 microprocessor that displays on the monitor the average of 2 numbers from an array?

How to write a program for mouse in microprocessor?


How do you write the average n numbers program in c language?

Write your program and if you are having a problem post it here with a description of the problem you are having. What you are asking is for someone to do your homework for you. no i am asking to verify my answer


Program in 'c' to find the LCM of any given five numbers?

Just write a method or function that calculates the LCM for two numbers at a time. Then calculate the LCM for the first two numbers, get the LCM of the result with the third number, etc.Just write a method or function that calculates the LCM for two numbers at a time. Then calculate the LCM for the first two numbers, get the LCM of the result with the third number, etc.Just write a method or function that calculates the LCM for two numbers at a time. Then calculate the LCM for the first two numbers, get the LCM of the result with the third number, etc.Just write a method or function that calculates the LCM for two numbers at a time. Then calculate the LCM for the first two numbers, get the LCM of the result with the third number, etc.


Write a program in Lex to eliminate white space and collect numbers as a token?

write a lex program to delete space from the program


Write a program to calculate first?

int first= 1;


Write the program in qbasic and add two numbers?

Cls input "enter two no.s ",a,b sum=a+b print "sum = ";sum end


How do you write an assembly language program to find the sum of n numbers using array?

write an assembly language program to find sum of N numbers


HOW TO SOLVE 'C' problem?

1. write a 'c' program to read 4(four)numbers from a file 'BANK' and calculate the average of the numbers.Now print the calculated average in another output file 'AVERAGE' 2. write a 'c' program that finds the sum and average of inputted five integer numbers of the array using dynamic memory allocation function malloc(). 3. write a 'c' program to create simple elements 1,2,3,4 in the link list of 4(four)nodes and display the list's elements. 4. write a 'c' program to convert the expression (A+B)/(C+D) into postfix expression into stack.and then evaluate it for A=10,B=20,C=15,D=5 and display the stack status after each operation. 5. write a 'c' programto create a linked list implemented on an array containing the following numbers:1,2,3,3,3,4,4,9 and pack it to remove the duplicate numbers.so that only the following data are contained by the nodes:1,2,3,4,9


Shell program for gcd of three given numbers?

write a shell program for finding out gcd of three given numbers? write a shell program for finding out gcd of three given numbers? write a shell program for finding out gcd of three given numbers? check bellow link http://bashscript.blogspot.com/2009/08/gcd-of-more-than-two-numbers.html


Unix script to calculate average of n numbers given by user?

You really don't want to do this in a shell script - scripting languages in Unix typically do not handle or work with floating values, only integers. A better way would be to write a program to do this that works under Unix, such as a 'C" program. See the related link for an example


How do you write a program in objective c numbers 1-100 prime numbers?

fdsgfhgdfhgdf


How to write a C program to find largest 2 numbers using pointers?

program to find maximum of two numbers using pointers