Question: Write a function that computes the average of the digits in an integer. Use the following function header: double averageDigits(int n) For example, averageDigits
Write a function that computes the average of the digits in an integer. Use the following function header: double averageDigits(int n) For example, averageDigits (936) returns 6.0 which is computed as (9 +3+6)/3. Also, write the main function that prompts the user to enter an integer and displays the average of the integer entered.
Step by Step Solution
3.37 Rating (144 Votes )
There are 3 Steps involved in it
Heres a C program that includes the averageDigits function to compute the average of the digits in a... View full answer
Get step-by-step solutions from verified subject matter experts
