Computer Science, asked by darshanrajesh, 2 days ago

write an algorithm and flowchart to find sum of odd and even number upto N

Answers

Answered by jayeshjangir00
3

ANSWER=

The algorithm as :

Step 1: Start.

Step 2 : Input N.

Step 3 : sume = 0.

Step 4 : sumo = 0.

Step 5 : ctr = 1.

Step 6 : while (ctr < = N). If (ctr mod 2 = 0) sume = sume + ctr else sumo = sumo + ctr.

Step 7: Print “sum of even number is” sume. Step 8: Print “sum of odd number is” sumo. Step 9: End.

Similar questions