sort by best latest
See if you can adapt the given program if I tell you that you can use the following line to check if a number is even:
if (n % 2 == 0)
where n is the variable that contains the number. The operator % performs the modulo operation, see http://en.wikipedia.org/wiki/Modulo_operation .
You can help the HubPages community highlight top quality content by ranking this answer up or down.
printf("Enter the number :");
printf("\nThe number is even");
printf("\nThe number is odd");
Copyright © 2017 HubPages Inc. and respective owners.
Other product and company names shown may be trademarks of their respective owners.
HubPages® is a registered Service Mark of HubPages, Inc.
HubPages and Hubbers (authors) may earn revenue on this page based on affiliate relationships and advertisements with partners including Amazon, Google, and others.