Write a program to find the sum of digits of an integer number, input by the user.
Answers
Answered by
9
Answer:
The program output is also shown below.
* C program to accept an integer & find the sum of its digits.
long num, temp, digit, sum = 0;
printf("Enter the number \n");
scanf("%ld", &num);
temp = num;
while (num > 0)
digit = num % 10;
sum = sum + digit;
Plz Plz Plz Mark me as BRAINLIEST
Similar questions
Science,
5 months ago
Math,
5 months ago
Hindi,
5 months ago
Computer Science,
10 months ago
Computer Science,
10 months ago
Physics,
1 year ago