From the course: C Essential Training
Unlock the full course today
Join today to access over 22,500 courses taught by industry experts or purchase this course individually.
Challenge: Work the grid - C Tutorial
From the course: C Essential Training
Challenge: Work the grid
(bright music) - [Instructor] This challenge presents the largest single update to the course project so far. Start your solution from the chapter three challenge or use my solution provided in exercise file 04_14, challenge one. Remove all the statements between the comment to process the rows and the return statement in the main function. You no longer need to output the value input. Instead, you must write a nested loop to process the grid. Further, you must write code that outputs every other row as a separator consisting of equal signs. Onto the details. The nested loop has an outside loop that processes the rows, which is the value input. Two inner loops are present. One processes the grid values and the other processes the separator row. For odd rows, output the current row number plus the letters A through J in pairs. Row letter, such as 1A, 1B and so on. For even rows, output 40 equal signs. Here are some…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
Making a decision3m 37s
-
Exploring the possibilities2m 34s
-
Using the ternary operator3m 1s
-
Working with the switch-case structure4m 9s
-
Challenge: Select an item29s
-
Solution: Select an item57s
-
Creating a for loop3m 58s
-
Setting up a while loop3m 6s
-
Challenge: Repeat some text48s
-
Solution: Repeat some text1m 40s
-
Nesting loops1m 55s
-
Breaking out of a loop3m 28s
-
Avoiding the goto keyword1m 56s
-
Challenge: Work the grid2m 21s
-
Solution: Work the grid2m 8s
-
-
-