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.

Chapter challenge: Write the functions

Chapter challenge: Write the functions - C Tutorial

From the course: Complete Guide to C Programming Foundations

Chapter challenge: Write the functions

(bright music) - [Instructor] Here's the setup for this chapter's challenge. You see a prompt for two values, input the values, then a series of functions appear which don't appear in the code. They're not written yet, add, subtract, multiply, and divide. Your task is to code these functions, all of which accept values, one of which returns values. Create the add function. It adds two integer arguments passed. It outputs this string assuming that the values are three and eight, and this function returns no values. Similarly, code the subtract and multiply functions. Their output is similar to the add function. Here are some examples of that output. Finally, code the divide function, which is different from the other three. This function accepts two integer values, but it does not output a string. Instead, it returns the result of the first value divided by the second. Use the challenge source code to clue you in to how this function is different if you need some hints. This exercise…

Contents