#include<stdio.h>
#include<conio.h>
#include<iostream.h>
void main()
{
int n;
clrscr();
cout<<"Enter any number = ";
cin>>n;
int sum=0;
while(n>0)
{
sum=sum+n%10;
n=n/10;
}
cout<<"Sum of digit = "<<sum;
getch();
}
///////////////////////////////////////////////////////////////////////////
Copy & paste this code in your TC & run, then you will get output.......
If you have any problem please comment below.........