Thread: 2 quick questions on C!

1. 2 quick questions on C!

Hi guys, I have 2 quick questions on C.

If I have a function, thisfunction (), if i want to apply multiple numbers into it, like 37, 0, 100, etc. how would i go about doing that? I'm really stumped. So I want it to be like this:

Code:
```//Prototype
void printEvenOrOdd (int 37, int 0, int 3, int 777, int 10000);

int main()
{
//Name:
printf("YOO HOO\n");
printf("Lab Exercise #10\n");
printf("Code::Blocks\n");
printf("\n");

//Statements:
printEvenOrOdd(37);
printEvenOrOdd(0);
printEvenOrOdd(3);
printEvenOrOdd(777);
printEvenOrOdd(10000);
return 0;
}

void printEvenOrOdd(int 37, int 0, int 3, int 777, int 10000)
{
//Not Finished yet!
}```
Am I using the prototype right? I'm stumped.

My other question is one where I'm looking on printing the word even if its even, or odd if its odd. I'm not looking for any spoon fed answers, maybe a link to a page on how its done, or hints on it, but I've been looking in our textbook and no luck. My brain is frying over the frustration an easy problem is making. :/

Thanks guys, you are awesome

2. Code:
` void printEvenOrOdd (int number);`

then you can use

Code:
```   printEvenOrOdd(37);
printEvenOrOdd(0);
printEvenOrOdd(3);
printEvenOrOdd(777);
printEvenOrOdd(10000);
```

what your doing is basically saying

i have a number, named number, and i send it to print if it is even or odd
then after it prints you make number a new number, and send it again

3. Oh that's interesting. I didn't know you literally type the word number for all numbers to go through. I feel like a dummy. Hehe.

It helps alot when you actually say it out. Thanks man <3

4. Hmm. I think you misunderstand. 'number' has no special meaning, it is just the name of the variable that Crossfire chose as a descriptive parameter for the function. It could very well have been 'whatchamacallit'.
It could even have just been
Code:
`void printEvenOrOdd( int );`
because prototypes ignore parameter names - the compiler only cares about the datatype.

Then
Code:
```void printEvenOrOdd( int num )
{
//here num is a local  variable that is given the value you
//passed to the function, i.e.
//printEvenOrOdd( 17 );

//you can manipulate num or use it in expressions
}```