Write a function called average1 that takes two integers as parameters and print
ID: 3911095 • Letter: W
Question
Write a function called average1 that takes two integers as parameters and prints their average. Write another function called average2 that takes two integers as parameters and returns their average. The first function doesn’t return anything (void) since it prints the result. Write both functions in the same C program and call both of them from main.
Write a function called averagel that takes two integers as parameters and prints their average. Write another function called average2 that takes two integers as parameters and returns their average. The first function doesn't return anything (void) since it prints the result. Write both functions in the same C program and call both of them from main. void average I (int, int); float averagel (int, int); Below is a sample output. The output should designate where we're printing from 3 Enter integer: 4 Enter integer: 9 Printing from function averagel: 6.500000 Printing from main: 6.500000Explanation / Answer
void average1(int,int);
float average1(int,int);
public double average (int num1, int num2)
{
return (num1 + num2) / 2.0;
}
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.