Computer Science, asked by harshali5342, 1 year ago

Program to find out sum of digits of given number with example

Answers

Answered by pkparmeetkaur
4
1+2=3

<marquee> ❣❣HOPE IT HELPS U❣❣

<marquee> ❣❣PLEASE MARK MY ANSWER AS BRAINLILIST ❣❣

<marquee> ❣❣THANKS ❣❣

☺☺☺

LuvKapoorr: kaar diya follow
suraj5321: hii
Answered by scientist1234
1
* 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;
Similar questions