- 2

Write a function that computes the average of the digits in an integer. Use (double averageDigits (long n)

About functions in c++

11th Nov 2021, 2:32 PM
Emmanuel Kiprotich
Emmanuel Kiprotich - avatar
1 Respuesta
+ 1
Try using the module (% 10) plugged into a loop.By making the module you get each separate digit. Then I have to update the number by removing the unnecessary digit by dividing by 10. And so on
13th Nov 2021, 8:33 PM
GiobirCode
GiobirCode - avatar