...

/

Discussion: Eenie, Meenie, Miney, Mod

Discussion: Eenie, Meenie, Miney, Mod

Execute the code to understand the output and gain insights into number classification.

Run the code

Now, it's time to execute the code and observe the output.

Press + to interact
#include <stdio.h>
int main()
{
int m = 1;
while( m<10 ) {
if( 2%m )
printf("%d - Odd\n", m);
else
printf("%d - Even\n", m);
m++;
}
return(0);
}

Modulo operator mantra

The modulo operator (%) ...