#include<stdio.h>
#include<conio.h>
void main()
{
clrscr(); //to add the digits of any five digits number
int p,q,r,s,t,u,v,w,x,y;
printf("enter any number of five digit\n for which you want to add its digits\n");
scanf("%d",&p);
q=p%10;
r=p/10;
s=r%10;
t=r/10;
u=t%10;
v=t/10;
w=v%10;
x=v/10;
y=q+s+u+w+x;
printf("%d",y);
getch();
}
Showing posts with label Sum of digits. Show all posts
Showing posts with label Sum of digits. Show all posts