Tosend CC102-Functions
Tosend CC102-Functions
C++
Functions
Melgine M. Bauat, MSIT
Asst. Professor III
The C++ Functions
A C++ function or a subprogram is simply a chunk of C+
+ code that has:
A descriptive function name: Examples
computeTaxes to compute the taxes for an employee
isPrime to check whether or not a number is a prime number
2 raised to 3 is 8
Visit https://www.programiz.com/cpp-programming/library-function for more
standard library functions
CC102 – Computer Programming, Intermediate
The C++ User-Defined Functions
A C++ User-defined functions are functions developed by
the programmer to implement in the program
FUNCTION HEADER.
Containing return value type, function
VALUE RETURNING FUNCTION. name, and parameters.
WRONG DECLARATION:
void employeeTax(double tax_percent=0.12, string employeename, double salary)
Actual Declaration.
Placed after int main
driver.