even numbers

October 8, 2009 at 14:52:46
Specs: Windows Vista
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.");



See More: even numbers

Report •

October 8, 2009 at 16:59:33
Post this in the Programming Forum... link on the right hand side of this page.

Home Page http://ewen.uuuq.com/

Report •
Related Solutions

Ask Question