CPPForSchool.com: User Defined Function Set 1: Assignment 2

2. Write a function to calculate the factorial value of any integer as an argument. Call this function from main( ) and print the results in main( ).


This assignment was a bit of an eye opener.  In the past, I have gotten rather accustomed to return 0 and utilizing custom void functions.  For this assignment, I had to ensure that I returned the factorial in order for the values to be relayed into int main().  Nevertheless, I had a pretty good time coding this exercise.  Below is my source code and outputs.  Also, the sample source and output has been posted for comparison.









Comments