For Advertisements on this blog Contact Us at developgram@gmail.com or +91-9923438816

Simple Programming Tutorials For Beginners

Sunday, December 11, 2016

Even Odd

/*
Summary: Check whether a number entered by user is even or odd.
*/

#include <stdio.h>
int main()
{
 int num;

 printf("Enter an integer you want to check: ");
 scanf("%d",&num);

  /* Checking whether remainder is 0 or not. */
 if((num%2)==0)
  printf("%d is even.",num);
 else
  printf("%d is odd.",num);
 return 0;
}

No comments:

Post a Comment

SEARCH THIS BLOG