***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'.
Look through this. Fiddle with it. Use your online help or crack the
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  
 
 [ 2 post ] 

 Relevant Pages 

1. ***Newbie Needs Help With Functions Program ***

2. I need help with a program newbie :)

3. c newbie needs help with programs!!

4. Newbie at programming needs help

5. C# NewBie need help:How to automatically create a MDI program by application wizard

6. Newbie needs help with function and popen

7. newbie in api, need help for the function AVIStreamGetFrame

8. newbie in api, need help for the function AVIStreamGetFrame

9. Help on a simple calculator program which needs Trigo, Arithmethic, log functions..[Apologies for repeat mail]

10. Help C newbie need help please

11. Help C newbie need help please

12. HELP -- NEWBIE NEEDS HELP

 

 
Powered by phpBB® Forum Software