I need help creating a beginning program

Hi I need to create a program that makes the user input numbers and the program then tells them if the number is even or odd. ill be back in an hour. get to work.
...Seriously?
Are you asking for our help, you asking for the answer? I can not speak for everyone, but I will not answer you with a complete program just because you need it.

I hope you didnt register for this site explicitly because you needed an answer.
Last edited on
Ok, I'm going to give you the benefit of the doubt and say you worded your question poorly.

Here is an unfinished version of your program.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <iostream>

using namespace std;

//Function to find out if a number is even or odd
void findNum(int input)
{
	
}

int main()
{
	//Input variable
	int input = 0;
	
	//Bool for the while loop
	bool go = true;

	//Beginning display message

	
	//While loop
	while(go)
	{
		findNum(input);
	}
	
	//Exit with zero
	return 0;
}


I want you to fill out the display message and even or odd function. Hint: use modulus.
Lol
Go to google.
An even function has reflectional symmetry about the y-axis, while an odd function has rotational symmetry about the origin. In other words, feven(x) = feven(-x), whereas fodd(x) = -fodd(-x). That should help you out.
he's not coming back because we didnt give him the answers to his homework. ;)
gghf wrote:
get to work.


No, why don't you get to work on your homework.
I'd like to make it clear enough for you @gghf. A number is even if n modulus 2 equals 0. A number is odd if it isn't even. I hope you understood that, and with the code given above, you shouldn't have any problems.

Best of wishes,
~ Raul ~
Topic archived. No new replies allowed.