Design an algorithm and the corresponding flowchart for finding the sum of
the numbers 2, 4, 6, 8, …, n
Declare Integer n
Declare Integer i
Declare Integer sum
Display "Ente N: "
Input n
Set sum = 0
Set i = 2
For i = 2 To n Step 2
Set sum = sum + i
End For
Display "Sum: ", sum
Comments
Leave a comment