write an program to print the sum of three digit numbers in C
Answers
Answered by
1
Answer:
# Python 3 program to
# compute sum of digits in
# number.
# Function to get sum of digits
def getSum(n):
sum = 0
while (n != 0):
sum = sum + int(n % 10)
n = int(n/10)
return sum
n = 687
print(getSum(n))
Answered by
1
Answer:
C program to accept a three digit number print the sum of individual digit of given number=
- main ( )
- {
- int a,b,c, n, sum;
- clrscr ( ) ;
- scanf("%d", & n) ;
- printf ("Enter Three digit Number:") ;
- getch ( ) ;
- }
hope it will help you
Similar questions