#include <stdio.h>
#include <conio.h>
void main()
{
long int s = 0,d;
clrscr();
printf ("ENTER ANY NUMBER :");
scanf ("%ld",&n);
while (n)
{
d = n % 10;
s = s + d;
n /= 10;
}
printf ("SUM OF DIGIT IS %d ",s);
getch();
}
#include <conio.h>
void main()
{
long int s = 0,d;
clrscr();
printf ("ENTER ANY NUMBER :");
scanf ("%ld",&n);
while (n)
{
d = n % 10;
s = s + d;
n /= 10;
}
printf ("SUM OF DIGIT IS %d ",s);
getch();
}
0 comments :
Post a Comment