***Newbie Needs Help With Functions Program ***
Author Message
***Newbie Needs Help With Functions Program ***

Hello,

I just started this C class and need a little help coding this
program.  If anyone can show me some examples of how to write a simple
program to put these 3 functions in one program.

1. long intPower(short base short exponent)
Accepts two short integers and returns a long. The long return

represents the result of raising the base integer to the
exponent integer power.

2. double average(int i, int j, int k, int l)
average should return the real average of 4 integers sent to
the function .

3. void blankLines(short n)
the function should be used to produce n number of blank lines
in the program output.

4.  A function theat is sent 5 integers and returns the highest of the

highest of the five.

Any help anyone can give me would be greatly appreciated.  I am so
confused right now.
--

Mon, 05 Mar 2001 03:00:00 GMT
***Newbie Needs Help With Functions Program ***
Wow! I can't believe you posted this!! You've got some big brass ones,
fella'.
books and figure out what to do. Don't be a lazy palooka.

/*******Example Starts****************/

#include<stdio.h>

double DivideTwoNumbers(int x, int y);

int main(void)
{
double quotient = DivideTwoNumbers( 43,13 );
printf("Quotient: %f \n", quotient);
return 0;

Quote:
}

double DivideTwoNumbers(int x, int y)
{
double q = (double(x)/double(y));
return q;
Quote:
}

/**** Example Ends **********/

Quote:
>1. long intPower(short base short exponent)
>       Accepts two short integers and returns a long. The long return

>       represents the result of raising the base integer to the
>       exponent integer power.

>2. double average(int i, int j, int k, int l)
>       average should return the real average of 4 integers sent to
>       the function .

--
Jim Murphy   cjmurphy<at>telusplanet.net

--

Fri, 09 Mar 2001 03:00:00 GMT

 Page 1 of 1 [ 2 post ]

Relevant Pages