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

1. Write a program using function which accept two integers as an argument and return its sum. Call this function from main( ) and print the results in main( ).

It appears that the ongoing theme of different coding styles is upon us.  Unlike the sample source code, I chose not to return anything within the User Defined Function, specifically for sumOfNums().  Also, to help reinforce what has occurred, I included an output of "x+y=sum", instead of just simply outputting the answer.  Below is my source code and output.  Lastly, I have included the sample source code and output.


***Although my source code did not follow the instructions in regards to printing within int main(), I went ahead forward because the concept is not lost on me.  I will implement the function as instructed within later assignments.  (I am just extremely eager to move forward)***









Comments

Popular posts from this blog

CPPForSchool.com: Variable, Operator & Expression Set 1: Assignment 9

CPPForSchool.com: Array - Single Dimension Set 1 Assignment 6

CPPForSchool.com: Variable, Operator & Expression Set 1: Assignment 8