From the course: C Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Challenge: Basic I/O

Challenge: Basic I/O - C Tutorial

From the course: C Essential Training

Start my 1-month free trial

Challenge: Basic I/O

(soft music) - [Instructor] To continue this course's challenge, grab your source code from chapter one's solution or use the exercise file provided, 02_13-challenge1 as a starting point. It's time to add some code. In the main function, after the first comment, you're going to prompt for input. Next, you're going to grab the input. And after the final comment in the main function, you're going to generate output showing the value input. Here are the specifics. Use a printf statement to prompt the user to enter a value, 18 maximum, representing a number of rows. Use the scanf statement to assign input to an integer variable, rows. Finally, use another printf statement to output how many rows the computer will process. Now if you need some helpful hints, examples of using the printf and scanf functions are shown in various movies in this chapter. This challenge should take you about 10 minutes to complete.

Contents