#include<stdio.h>
#include<conio.h>
main()
{
int rem,sum=0,n
clrscr();
printf("Enter n : ");
scanf("%d",&n);
while(n>0)
{
rem=n%10;
sum=sum+rem;
n=n/10;
}
printf("Sum of digits....%d",sum);
getch();
}
#include<stdio.h>
#include<conio.h>
main()
{
int rem,sum=0,n
clrscr();
printf("Enter n : ");
scanf("%d",&n);
while(n>0)
{
rem=n%10;
sum=sum+rem;
n=n/10;
}
printf("Sum of digits....%d",sum);
getch();
}