Tuesday, 9 April 2013

Total sum of an array indexes in c++






#include <iostream>
using namespace std;
void main ()
{

int arra[5];
int value=0;

for(int i=0;i<5;i++)
{

cout<<"insert value of index["<<i+1<<"] :";
cin>>arra[i];
value =value+arra[i];

}
cout<<"Totol sum :";
cout<<value<<endl;


}





c++ one dimensional array

0 comments:

Post a Comment