Discussion: Eenie, Meenie, Miney, Mod
Execute the code to understand the output and gain insights into number classification.
We'll cover the following...
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);elseprintf("%d - Even\n", m);m++;}return(0);}
Modulo operator mantra
The modulo operator (%
) ...