Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- main(){
- int n, counter = 0, sum = 0;
- scanf("%d", &n);
- while(n != 0){
- sum += n%10;
- n /= 10;
- counter++;
- }
- printf("%.2f", (float)sum/counter);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement