// try #2 #include #include int constant; int mainhold; int lastdigit; int carrycount = 0; int maincount = 0; int main() { printf("Enter an integer between 0 and 32,767\n"); scanf("%d", &constant); while (maincount < 5) // this loop is set up to up maincount (and by extension carrycount) by one value { mainhold = constant; // sets mainhold as the number entered carrycount = maincount; while (carrycount < 5) { lastdigit = mainhold % 10; // sets lastdigit as the last digit of mainhold if (carrycount < 6) { printf("%d ", lastdigit); } // ends if statement mainhold = mainhold - lastdigit; // removes the number on the end mainhold = mainhold / 10; // divides by ten carrycount++; } // end inner while statement printf("\n"); maincount++; } getch(); return 0; }