Write a c++ program to find the sum of digit of a number
Answer»
#includeusing namespace std;int main() { int x, s = 0; COUT << "Enter the number : "; cin >> x; while (x != 0) { s = s + x % 10; x = x / 10; } cout << "\nThe sum of the digits : "<< s;}outputEnter the number : 236214828The sum of the digits : 36