Recent Posts

9-latest-250px-course

Write a C program to Check whether the number is odd or even without using mod operator

Write a C program to Check whether the number is odd or even without using mod operator



Program:-     

#include <stdio.h>

int isEven(int n)

{

return (!(n & 1));

}

int main()

{

int n;

printf(“\nEnter a number : “);

scanf(“%d”,&n);

printf(“\n”);

printf(“\n%d is “,n);

isEven(n) ? printf(“Even\n”) : printf(“Odd\n”);

return 0;

}

Output:-

....
SHARE

Milan Tomic

Hi. I’m Designer of Blog Magic. I’m CEO/Founder of ThemeXpose. I’m Creative Art Director, Web Designer, UI/UX Designer, Interaction Designer, Industrial Designer, Web Developer, Business Enthusiast, StartUp Enthusiast, Speaker, Writer and Photographer. Inspired to make things looks better.

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment