// Wyo C++ Ch. 6 Demo #5 // purpose - to determine the digits of a 4 digit integer #include <iostream.h>int main() { int num = 0; int nextDigit = 0; int onesDigit = 0; int tensDigit = 0; int hunsDigit = 0; int thousDigit = 0; cout << "Enter a number: "; cin >> num; onesDigit = num % 10; num /= 10; tensDigit = num % 10; num /= 10; hunsDigit = num % 10; num /= 10; thousDigit = num % 10; cout << "The ones digit is " << onesDigit << endl; cout << "The tens digit is " << tensDigit << endl; cout << "The hundreds digit is " << hunsDigit << endl; cout << "The thousands digit is " << thousDigit << endl; return 0; }// end of main