Create your own function in C that accepts one input parameter and returns a float number. The...

Question:

Create your own function in C that accepts one input parameter and returns a float number. The function is for a car payment (say $260) times 5% interest.

Functions in C:

A function in C is a group of statements that perform a specific task, every C program has at least one function, main(), but we can write our own functions.

When writing a function in a C program, it is good practice to create a function prototype that is declared before main, specifying the signature, in the form of <return type> <function name> <(function parameters)>, if we do not need the function to return anything, return type can be specified to void.

Functions are great tools that help reduce code redundancy, and significantly increase code readability and simplicity when used right.

Answer and Explanation:

Become a Study.com member to unlock this answer!

View this answer

See full answer below.


Learn more about this topic:

Loading...
5 Basic Elements Of Programming

from

Chapter 11 / Lesson 6
123K

Computer programming is built upon five basic elements, including the input, output, loops and conditionals, mathematical, and variables and data structures. Explore the concepts of computer programming, discover the five core elements of programming, and find out how each element contributes to a computer program.


Related to this Question

Explore our homework questions and answers library