....you can use % to do it~~~~~
just like chrisname said~~~~~~
odd numbers cannot be divided by 2~~~~~
use % to do it~~~
if the number is even what will be the answers??
if the number is odd what will be the answers??
actually, depending on your programming habbits, you could declare a[10] and start with 1, though you're wasting a very tiny amount of memory. It would be better to get into the habbit of using zero index array, and declare a[9] to hold 10 number. Including the one at a[0].
scratch all of that. My mind isn't fully awake yet this morning.
actually, depending on your programming habbits, you could declare a[10] and start with 1, though you're wasting a very tiny amount of memory. It would be better to get into the habbit of using zero index array, and declare a[9] to hold 10 number. Including the one at a[0].