Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I have to write a program that inputs a series of integers and passes them one at a time to function even, which uses the remainder operator to determine if an integer is even. The function should take an integer argument and return 1 if the integer is even and 0 otherwise. I am confused, i do not what else i have to do to return the even integer to 1 or the odd integer to 0....I have this so far:
#include <iostream>
int main()
{
int number;
printf ( "Enter a number:\n");
scanf("%d", &number);if (number % 2 == 0)
printf ( "The number is even.");
else printf ( "The number is odd.");system("PAUSE");
}

Post this in the Programming Forum... link on the right hand side of this page.
Home Page http://ewen.uuuq.com/

![]() |
![]() |
![]() |
| Login or Register to Reply | |
| Login | Register |
| Ads by Google |