#include <stdio.h>
#include <math.h>
int main()
{
int number;
int sum;
scanf("%d", &number);

while(number>0)
    {
    sum=sum+(number%10);
       number=number/10 ;
    }
printf("%d",sum);
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: