From the course: Complete Guide to C Programming Foundations
Unlock the full course today
Join today to access over 24,500 courses taught by industry experts.
Challenge: Get the order correct - C Tutorial
From the course: Complete Guide to C Programming Foundations
Challenge: Get the order correct
(upbeat music) - [Instructor] Your challenge is to get the order correct in a C language mathematical expression. You have been hired as a programmer at a museum that's raised enough money to afford its own programmer. Your task is to write a program that calculates the total number of artifacts in the museum. You can use code from the exercise file 03_06 Challenge 1 to get started. Here are the details. The museum has 12 rooms. Each room has 16 paintings and four sculptures. Write an equation that calculates the number of artifacts in the museum and output the result. And I can offer you a hint because I'm a nice guy: the proper result is 240, not 196. This challenge should take you 10 minutes to complete, probably less.
Contents
-
-
-
-
-
Working with math operators3m 13s
-
(Locked)
Challenge: Do some math50s
-
(Locked)
Solution: Do some math1m 47s
-
(Locked)
Using assignment operators1m 49s
-
(Locked)
Obeying the order of precedence3m 14s
-
(Locked)
Challenge: Get the order correct55s
-
(Locked)
Solution: Get the order correct1m 37s
-
(Locked)
Working with relational operators3m 48s
-
(Locked)
Using logical operators3m 58s
-
(Locked)
Understanding bitwise operators3m 44s
-
(Locked)
Shifting bits3m 13s
-
(Locked)
Exploring unary operators3m 3s
-
Chapter challenge: More math1m 8s
-
(Locked)
Chapter solution: More math2m 45s
-
-
-
-
-
-
-
-
-