-
May 8th, 2010, 02:10 PM
#1
Quick Help Simple Question
I am having problems writing a function that calculates the average of 5 numbers inputted by user. This is all very confusing to me and has been eversince they were introduced. I am not sure which parameters to use i think it should look like
int funcAverage (int numbers, int sum)
really do not know how to write the definition and this is where I need help. I am not sure which variables go where. I dont want you guys to do the work for me, I just need soeone to explain how this all goes together. I am at a point of complete frusteration and am ready to quit.
-
May 8th, 2010, 02:18 PM
#2
Re: Quick Help Simple Question
Since the program only requires 5 numbers should I harcode that into the function
ie.
int funcAverage(int num1, int num2, int num3, int num4, int num5, int sum)
-
May 8th, 2010, 07:34 PM
#3
Re: Quick Help Simple Question
int funcAverage(int num1, int num2, int num3, int num4, int num5, int sum) would be the simplest or you could put the *******s in an array and pass by address
-
May 9th, 2010, 01:37 AM
#4
Re: Quick Help Simple Question
Code:
int Average(int array[5]);
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|