#include<conio.h>
#include<stdio.h>
void main()
{
int n,i,sum=0,rem;
printf("Enter Any Number : ");
scanf("%d",&n);
for(i=n;n>0;(n=n/10))
{
rem=n%10;
sum=sum+rem;
}
printf("\n Sum : %d",sum);
getch();
}
#include<stdio.h>
void main()
{
int n,i,sum=0,rem;
printf("Enter Any Number : ");
scanf("%d",&n);
for(i=n;n>0;(n=n/10))
{
rem=n%10;
sum=sum+rem;
}
printf("\n Sum : %d",sum);
getch();
}
0 comments:
Post a Comment