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
(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.
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
-
-
-
-
Understanding C language data types3m 4s
-
(Locked)
Declaring variables2m 49s
-
(Locked)
Working with variables2m 55s
-
(Locked)
Exploring the printf() function3m 4s
-
(Locked)
Using constants2m 53s
-
(Locked)
Challenge: Make variables and constants47s
-
Solution: Make variables and constants1m
-
(Locked)
Understanding variable scope3m 8s
-
(Locked)
Making new data types3m 24s
-
(Locked)
Specifying characters and strings3m 17s
-
(Locked)
Specifying integers and real numbers4m 14s
-
(Locked)
Typecasting a variable3m 11s
-
(Locked)
Challenge: Basic I/O1m 10s
-
(Locked)
Solution: Basic I/O1m 35s
-
-
-
-
-