menu search
brightness_auto
more_vert
Write a program in C++, to read array of 10 elements and print its sum.
thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike

1 Answer

more_vert
 
verified
Best answer

#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_off_alt 0 like thumb_down_off_alt 0 dislike

Related questions

thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike
0 answers
thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike
0 answers
thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike
1 answer
thumb_up_off_alt 1 like thumb_down_off_alt 0 dislike
0 answers
thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike
1 answer

Welcome to Brainiak.in , where you can ask questions and receive answers from other members of the community ,

There is many categories for every students  CBSE , Maharashtra board , JEE , NEET  and we will add more categories

and make brainiak one of the most loved community of students

Advertisement

Get Your advertisement on Brainiak.in Buy Adspace

3.0k questions

2.5k answers

24 comments

340 users

...