Split a number and store it in vector

#include <iostream>
#include <vector>

int main() {
    // Step 1: Declare variables
    int number, digit;

    // Step 2: Read input number from user
    std::cout << "Enter a number: ";
    std::cin >> number;

    // Step 3: Declare a vector to store individual digits
    std::vector<int> digits;

    // Step 4: Split the number and store digits in the vector
    while (number > 0) {
        // Extract the last digit
        digit = number % 10;

        // Add the digit to the vector
        digits.push_back(digit);

        // Remove the last digit from the number
        number /= 10;
    }

    // Step 5: Display the vector elements in reverse order
    std::cout << "Individual digits in reverse order: ";
    for (auto it = digits.rbegin(); it != digits.rend(); ++it) {
        std::cout << *it << " ";
    }

    return 0;
}