Computer Science, asked by nonu7389, 10 months ago

Write a program to find the sum of digits of an integer number, input by the user.

Answers

Answered by Anonymous
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