Simple function

I have three problems due in 3 more hours. I thought I could figure them out easily so yes, I waited till the last minute. I know they are fairly simple but don't know what to do.

1. Give the function prototype for a function named 'f' which returns a double and takes in three integers. Give the function prototype for a function named 'g' which returns nothing and takes in an 'char' and a 'bool', in that order.

2. Give the function definition for a function named 'h' which returns either (Boolean) true or false, depending on whether or not the integer passed in is odd. Note, we're asking for 'definition', not 'prototype'.

3. Suppose we've included the appropriate library which gives us access to the 'rand' function. Write the function definition for a function named 'roll' which takes an integer (which represents the number of sides of the die) and returns a random integer in the range 1 through #sides, inclusive. The call would look like this: int num = roll(6); // simulates rolling an ordinary die



Thanks
closed account (N8RzwA7f)
1. double f (int var1, int var2, int var3);
void g (char var1, bool var2);
2. bool h (int var1) {
return( var1 % 2 == 1);
}
3. can't be bothered .

should start sooner next time. Is this hs homework ?
Make use of the resources supplied by the internet.
http://www.cplusplus.com/doc/tutorial/functions/
hey i have one too ca anyone help
Thanks everyone that helped
Topic archived. No new replies allowed.