Computer Science, asked by amrithadharan, 3 months ago

write an algorithm to find the sum of first n natural number?
please help​

Answers

Answered by sk12532
0

Answer:

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; Here in this Algorithm we declare 3 variables n for storing the number, i for running the for loop and sum for storing the sum. Read the number n.21-Mar-2021

Similar questions