write a c program to input the number and print the even number
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 .
printf("Enter the number :");
printf("\nThe number is even");
printf("\nThe number is odd");
by Naveed Ahmed2 years ago
How to write a simple C Program for calculating a sum of integers?In C Programming using C++ Environment, I want to calculate the sum of some continuous integers, say 1 to 10. I have studies some loop structures like...
by aparnatrivedi7 years ago
Write a C program to compute the average marks in a subject of all the students in a class.
Copyright © 2018 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.