menu search
person
Write a program in C++, to read array of 10 elements and print its sum.
thumb_up_alt 0 like thumb_down_alt 0 dislike
5 views

1 Answer

 
verified

#include<iostream>

using namespace std;

 int main()

  {

   int arr[10],i,sum=0;

   cout<<"Enter any  elements in Array: ";

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

   {

   cin>>arr[i];

   }

   cout<<"Sum of all Elements are: ";


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

   {

    sum=sum+arr[i];

   }

  

  cout<<sum;

  }


Output:: 

thumb_up_alt 0 like thumb_down_alt 0 dislike
...