0

Hello, i need some help in c language

Calculate the amount and average value of the digits in a number. User input. I just can't include average value in this code #include <stdio.h> int main() { int n, s; printf("Enter number : "); scanf("%d",&n); s = 0; while (n > 0) { s += n%10; n /= 10; } printf("Sum of digit : %d\n",s); return 0; }

25th Mar 2020, 2:55 PM
Joey Tribbiani
Joey Tribbiani - avatar
1 Antwort
0
What have you tried so far? Post your try.. Then some one help you to complete task..
25th Mar 2020, 6:54 PM
Jayakrishna 🇮🇳