Check Number is even in C Programming

 #include   <stdio.h>

#include   <stdbool.h>


int  main() {

int  number;

printf( "isEven? \n" );

printf( "\n" );

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

scanf( "%d" , &number);

printf( "\n" );

bool  isEven =  true ;


//Even number checker

if  (number % 2 != 0) {

isEven =  false ;

}


if  (isEven) {

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

}

else  {

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

}

printf( "\n" );

return  0;

}

You may like these posts