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 sum of all values in an array



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