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: Do some math - C Tutorial
From the course: C Essential Training
Challenge: Do some math
(upbeat music) - [Instructor] In this challenge, you're going to do some math, or more precisely, the computer is going to do some math. You're going to code the equations. Use the source code from exercise file 03_02-challenge1 to help get you started. Declare three variables, a, b, and c. Add assignments for these three variables, a, b, and c, as shown by a comment in the code. Assign the value 15 to variable a. Assign variable a divided by 2 to variable b, and finally, assign the value of variable b multiplied by 4 to variable c. This challenge should take you under 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
-
-
-
-
-
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
-
-
-
-