Originally Posted by
meatloaf
Code:
for (int x=0; x<16; x=x+1)
{
printf("%d: *", x);
printf("\n");
}
This is what I have been using for the initial number. The lesson i watched included only integers in the for loops. Am I able to use a char object? Do i need to? The repeating star is the only thing i can't figure out.
Try my following suggestions:
Code:
// In this case, start x at 1 not 0
// x++ or ++x instead of x=x+1, more efficient
for (int x=0; x<16; x=x+1)
{
printf("%d: ", x);
// Add a second for() loop here to print the multiple '*'
printf("\n");
}
I would align the ':' to make it look cleaner, but not part of the initial assignment you posted.