better is a solution with some more intelligence.
I wrote some code, I hope it works, but it should show my concept.
- for Loop for line output
- flag array to print stars
for( int i = 0; i < 8; i++)
{
printf("0"+i);
}
printf("\n");
int stars[] = {5,7,4,2};
for(int l = 0; l < 4; l++){
for(int i = 0; i < 8; i++){
if( stars[l] == i ) ? printf("*") : printf(" ");
}
printf("\n");
}