All pastes #756975 Raw Edit

Miscellany

public c v1 · immutable
#756975 ·published 2007-10-31 21:17 UTC
rendered paste body
 // try #2#include <stdio.h>#include <conio.h>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;}