In this challenge, you are presented with a math puzzle and asked to write code that performs a specific calculation. Ensure that the math calculation is done in the proper order, or that parentheses are used, so that the result accurately reflects the value.
(upbeat music) … - [Instructor] Your challenge is to get the order correct … in a C language mathematical expression. … You've 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. … Use the code from exercise file 03_06 challenge1 … to get started. … Here are the details. The museum has 12 rooms. … Each room has 16 paintings and 4 sculptures. … Write an equation that calculates the number of artifacts … in the museum and outputs the result. … I could offer a hint. … The proper result is 240, not 196. … This challenge should take you about 10 minutes to complete. … …
- Writing your first C program
- Working the C development cycle
- Adding comments to code for clarity
- C language data types
- Declaring variables
- Making new data types
- Typecasting variables
- Using math, assignment, and logical operators
- Creating for and while loops
- Nesting loops
- Creating functions
- Returning values from functions
- Passing arguments to functions
- Creating recursive functions
Skill Level Intermediate
C: Data Structures, Pointers, and File Systemswith Dan Gookin2h 57m Intermediate
1. The Fundamentals of C
2. Variables and Values
3. Operators and Math
4. Decisions and Loops
Next steps1m 38s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.