write an algorithm and flowchart to find sum of odd and even number upto N
Answers
Answered by
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
Math,
1 day ago
Accountancy,
1 day ago
Computer Science,
1 day ago
English,
2 days ago
Math,
2 days ago
English,
8 months ago