One thing caught my eye.
Code:
int ResColour(int input)
{
switch(input)
{
case 0: printf( " Black");
break;
case 1: printf( " Brown");
break;
case 2: printf( " Red");
break;
case 3: printf( " Orange");
break;
case 4: printf( " Yellow");
break;
case 5: printf( " Green");
break;
case 6: printf( " Blue");
break;
case 7: printf( " Violet");
break;
case 8: printf( " Grey");
break;
case 9: printf( " White");
break;
default: printf( " Too big");
return(input);
}
}
If the default case was not executed, the function returns an undefined value.
Also, I don't like large switch statements like that which do basically the same thing. You could use something like this, or you could leave it as it is if this looks too complicated:
Code:
const char *colour[] = {
"Black", "Brown", "Red", /* ... */
};
if(input >= 0 && input <= 9) {
printf(" %s", colour[input]);
}
else printf(" Too big");
Oh yes, and this is entirely optional, but this
Code:
divisor = divisor / 10;
could be written as