I have a question or two about the following code segment that I hope someone will answer. This was part of a source code file provided on the CD, so I did not pick the variables.
void output(float a)
printf("The average is %.2f\n", a);
int num1, num2, num3;
num1 = input(1);
num2 = input(2);
num3 = input(3);
ave = average3(num1, num2, num3);
1) When passing ave to output as 'a' why don't we have to declare 'float a;' in the function--or are we in essence doing that when we declare the function?
2) I have seen a couple different examples of parameters that should be included in the main(). In a case like this, what would be the recommended parameter(s) to include for main to receive? ...void?
The texts I have don't seem to agree and I have no one else to ask; so I very much appreciate the help.