Write algorithm for sum of n natural number
Answers
Answered by
1
Explanation:
Declare a variable n, i and sum as integer; Read number n ; for i upto n increment i by 1 and i=1 { sum=sum+i; } Print sum; ... Read the number n. We use for loop and increment the loop by 1 upto n. Then we add the numbers and store it in sum.
Similar questions
Social Sciences,
3 months ago
Math,
3 months ago
English,
4 months ago
Computer Science,
1 year ago
Math,
1 year ago
Math,
1 year ago