Function (C++)

A function is a named, reusable block of code. In C++ you declare its return type, name, and parameters, then call it to run its body and optionally get a…