Determine if the sum of 2 numbers is odd or even | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Determine if the sum of 2 numbers is odd or even

Hi! I'm in my senior in highschool with zero to none experience and knowledge about programming and I'm not sure if this is the right place to ask but I'm desperate for answers. In my computer programming class my teacher asked us to create a Flowchart that determines if the sum of 2 numbers is odd or even and I didn't quite understand it. So if anyone is kind enough to draw one for me and explain to me how everything works like the shapes and their meanings I'll be very very grateful.

17th Jun 2017, 9:40 AM
Gab
Gab - avatar
2 Answers
+ 1
@Calvin Condition should be sum variable % 2 = 0.If that is true than its even else its odd. @Gab You should use the % operator because if the sum is even and you divide it with 2 then the remainder will be 0.If the sum is odd then the remainder will not be 0.Thus, it is odd. if (sum variable % 2 == 0) Print (even); else Print (odd); Hope this helps. 😊
17th Jun 2017, 2:08 PM
Julian Aung
Julian Aung - avatar
0
Set variable of first number ⬇ Set variable of second number ⬇ Set variable of the sum of the 2 variables ⬇ Condition: Check if the sum variable % 2 is true ⬇ If yes, the answer is even, else the answer is odd.
17th Jun 2017, 12:07 PM
Calviղ
Calviղ - avatar