Geography, asked by nancyyy, 1 year ago

If the question is "Write a program to find the sum of the series" What does this question means and what we have to do in this program ?
question from computer science Java

Answers

Answered by Smokedem1
1
Find the sum of the series.....
Eg:- the series is...... 1+2+3+4+5.......
Then the sum would be 15.
You will need a for loop which starts from the beginning value(here, 1) and goes till the upper limit(here, 5)
.inside the for loop,the statement should be added: sum=sum+i;(where the variable 'sum' has been initialized with 0)
Print the sum outside the loop and u ll get the output
Similar questions