Two nested for
loops, the outer for lines and the inner for columns. In the inner, add a check that for every N (where N is the third number) you print a space instead of an asterisk.
Printing asterisks from file data [closed]
Question
I am new to programming in C and I have the following task to complete:
Write a program that reads from a file with three numbers. First two numbers represent the height and width of a rectangle generated using asterisks (*). The third number represents a recurring gap among the (*)
on each row of the rectangle.
Example file layout 5 8 3
Console output
** ** **
** ** **
** ** **
** ** **
** ** **
... I am OK when it comes to reading the file, I have just hit a road block when it comes to replacing the numbers with asterisks and adding a space. I understand that I should be looking at learning loops probably a for
for this particular task.
Please could someone give me some good websites, reading material or code hints where I can try and learn about loops, there are so many websites out there I just wondered where the best place for a begginer in C such as myself should go to learn quickly and efficiently.
Any recommendations would be great :)
Thank you!
Solution