Day 14


 Hello.

What you learned today is not new, it is just an application of what you learned in the previous two days

Today I learned how to add even and odd numbers

In the previous two days we learned how to print even and odd numbers and I showed you the codes that I used

Today we will ask the user to write numbers randomly and we will use the if code that we learned previously to separate even and odd numbers, so we say (if num %2=0) We used to print previously that it is even, but now we will store all the even numbers that the user entered and collect them and store them in a variable called sumeven

And likewise with the odd numbers that result from else and we collect them and put the result in a variable called sumodd and print the two results to the user

Thus we have applied and collected the even numbers alone and the odd numbers alone through a program from what we learned previously

تعليقات

المشاركات الشائعة