Our Recommendation for You Search your Query, You can find easily. for example search by book name or course name or any other which is related to your education

Followers

How to calculate the average of all the values in the array



This is the source code to calculate the average of all the values in the array
#include<iostream.h>
#include<conio.h>
main()
{
      int A[5]={3,6,9,12,15};
      int sum;
      float average;
      sum=A[0]+A[1]+A[2]+A[3]+A[4];
      average=sum/5;
      cout<<"Average="<<average<<endl;
      getch();
      }
End