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: Binary math - C Tutorial
From the course: C Essential Training
Challenge: Binary math
(upbeat electronic music) - [Instructor] Continuing this course challenge, you can use your solution from chapter two, or my solution provided in exercise file 03_13-challenge1.c. You have two major updates to the code. Add code to check input. Ensure that input doesn't exceed 18. Add code to half the value input, as well as double the value input. Here are the details. Below the comment about avoiding out of range values, add aniftest to confirm that input is less than 18. If not, reset the value of variable rows to 18. Below the comment about processing the rows, use binary math to obtain half the value input, then output this value, then use binary math to output double the value input. Sounds like a lot of work, but you can do it. This challenge should take 10 minutes or less 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
-
-
-
-
-
Working with math operators3m 3s
-
(Locked)
Challenge: Do some math49s
-
(Locked)
Solution: Do some math1m 29s
-
(Locked)
Using assignment operators1m 44s
-
(Locked)
Obeying the order of precedence3m 13s
-
(Locked)
Challenge: Get the order correct54s
-
(Locked)
Solution: Get the order correct1m 11s
-
(Locked)
Working with relational operators3m 39s
-
(Locked)
Using logical operators3m 49s
-
(Locked)
Understanding bitwise operators3m 36s
-
(Locked)
Shifting bits3m 18s
-
(Locked)
Exploring unary operators3m 44s
-
(Locked)
Challenge: Binary math1m 5s
-
(Locked)
Solution: Binary math2m 11s
-
-
-
-