C++ program to Display the Sum of the digits of a given Number

C++ program to find sum of digits of a number.Try to make Simple C++ Program to Find Sum of Digits of a Number.Now Make it.

C++ Program to Find Sum of Digits of a Number

#include<iostream>
#include<conio.h>
using namespace std;
int main()
{
unsigned long i,p,n,sum=0;
cout<<"Enter any Number:";
cin>>n;
while(n!=0)
{
p=n%10;
sum+=p;
n=n/10;
}
cout<<endl<<"Sum of digits is:"<<sum;
return 0;
}

Output of Program

Enter any number : 584 
Sum of digits : 17