+ 2

# How can i calculate d sum of array??

for eg i wll take 11 subject of marks int m[11] then i has to calculate d percentage so what can i do?

7 Answers

+ 4

logic after getting marks of user :
for(int i = 0;i<11;i++)
{
sum = sum + marks[i];
}

+ 4

it will go long. you have to add all elements.
like this
sum = mark[0] + mark[1] + mark[2] + mark[3] + mark[4] + mark[5] + mark[6] + mark[7] + mark[8] + mark[9] + mark[10]

+ 1

int sum =0;
for (int i=0;i<m.length; i++){
sum +=m[i];
}

0

Raj Chhatrala can i get sum without using loop???

0

T0nd3 can i dont use without using loop

0

ohhhhh
BTW thnxxxx Raj Chhatrala

0

Raj Chhatrala if u want to accept m[11] then what can i do??? n where i put 11 subject of marks???

Hot today

What is indentations... ?

4 Votes

Need solution

0 Votes

What is the best coding language

0 Votes

YouTube Link Finder

0 Votes

Need solution

0 Votes