Check Number is odd or not in C Program

 #include   <stdio.h>

#include   <stdbool.h>


int  main() {

int  number;

printf( "isOdd? \n" );

printf( "\n" );

printf( "Enter the number to be checked \n" );

scanf( "%d" , &number);

printf( "\n" );

bool  isOdd =  true ;


//Even number checker

if  (number % 2 == 0) {

isOdd =  false ;

}


if  (isOdd) {

printf( "It is an Odd Number \n" );

}

else  {

printf( "Not an Odd Number \n" );

}

printf( "\n" );

return  0;

}

You may like these posts