This C++ program can find the sum of digits of a number. User needs to enter a number for example, take number xyz. Why user enters this number, computer will say, the answer is x+y+z
For example if the number is 101, the result should be 1+0+1 ie, 2.

Program to Find Sum of Digits

Int main()
   int n,temp,s=0;
   cout<<"Enter Your Number: ";
   cout<<"Sum of Digits: "<<s;


Enter Your Number: 101
Sum of Digits: 2