Question #295091

Design an algorithm and the corresponding flowchart for finding the sum of




the numbers 2, 4, 6, 8, …, n

Expert's answer



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
LATEST TUTORIALS
APPROVED BY CLIENTS