C Program – Print the sum of digits of given number

By | 2017-08-25T09:30:30+00:00 August 25th, 2017|c-program|0 Comments

C Program to print the sum of digits of given number.

Sum of Digits :

int main(void) 
    int n,sum=0,rem; 
    printf("Enter a number to Calculate Sum: "); 
        rem = n%10;     
    printf("Sum of Digits=%d\n",sum); 
    return 0; 

[box type=”success” align=”alignleft” class=”” width=”100%”]

Enter a number to Calculate Sum: 56489
Sum of Digits=32


Happy Learning 🙂


About the Author:

Hi Folks, you have reach this so far, that shows you like what you are learning. Then why don't you support us to improve for bettor tutorials by leaving your valuable comments and why not you keep in touch with us for latest updates on your favorite blog @ facebook , twitter , Or Google+ ,

Leave A Comment