The sum of the components in vectors.
How can I get the sum of the components that I introduce in v[i]?
1 2 3 4 5 6
|
int v[9],a,b,i;
cin>>a;
for (i=0;i<a,++i) {
cout<<"v["<<i+1<>v[i];
}
b=//how can I make the sum of the numbers that i introduced in v[i]?;
|
Topic archived. No new replies allowed.