I dont understand the workflow of a program :     #include <iostream>
    int main() {
    int nr;
    std::cin>>nr;
        while (nr > 0) {
        int digit = nr % 10;
        nr /= 10;
        std::cout<<digit;
        }
    return 0;
    }

Can someone please explain the workflow of this program, basically with the input "32" it outputs "23", that is good, thats my goal, my question is, why does it say "23" instead of just "2", why is the "3" being added in the end if i only said "cout digit". I get that the "3" comes from " nr /= 10", but why is it being outputed near the "2" to farm the answer "23"?