I have to print numbers like so
The assignment "The rst number is printed right-justified in 5 spaces then a colon is printed then then number of steps is written as a left justified number in 5 spaces"
The code I have now prints numbers like so
3:7 4:2 5:5 6:8 7:16 8:3 9:19 10:6
11:14 12:9 13:9 14:17 15:17 16:4 17:12
18:20 19:20 20:7
This is the code to print that table.
void makeTable(int start, int end) {
for(int i = 0; i<=end-start; i++) {
printf("%5d:%d", i+start, hofpo(i+start));
if(i>0 && i % 7 == 0) {
printf("\n");
}
}
printf("\n");
}
How do I print the numbers in the format that is needed?