// Given a five digit integer, print the sum of its digits.
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
 
int main()    
{    
int n,sum=0,m;     
scanf("%d",&n);    
while(n>0)    
{    
m=n%10;    
sum=sum+m;    
n=n/10;    
}    
printf("%d",sum);    
return 0;  
}

Embed on website

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