266,722 views
15 votes
15 votes
Write an algorithm to find the sum of first 10 natural numbers​

User Mantas Vidutis
by
2.9k points

1 Answer

22 votes
22 votes
Supposed we have an array called A, the numbers on it.

Int count = 0
Int i = 0

While(count < 10 && iIf(A[i] >= 0){
count ++;
}
i++;
}
User Spinkus
by
2.8k points