Możesz "skrócić" switch()
#include <stdio.h>
void LCD_WriteText(char *ch)
{
printf("%s\n",ch);
}
int main()
{
char hoursBuffer[3];
for (int hours=0; hours<=24; ++hours) {
switch (hours) {
case 24:
case 0:
LCD_WriteText("00");
break;
case 1 ... 9:
sprintf(hoursBuffer, "0%d", hours);
LCD_WriteText(hoursBuffer);
break;
default:
sprintf(hoursBuffer, "%d", hours);
LCD_WriteText(hoursBuffer);
}
}
return 0;
}