//////////////////////////////////////// // AddNumbers // param1 firstParam - The first value to add // param2 secondParam - The second value to add // return - The firstParam added to the secondParam // int addNumbers( int firstParam, int secondParam ) { // Here is some info int theReturn = firstParam + secondParam;
// Now return the value return theReturn; }
// Entry for program int main() { // Initialize variables int firstParam = 5; int secondParam = 6;
// Call the function int returnValue = AddNumbers( firstParam, secondParam );
// Print out the value printf("%d+%d=%d", firstParam, secondParam, returnValue );
return 0; }
Name:
Anonymous2014-09-05 19:48
second but you need bigger names (Parameter instead of param for example) And typedef int to integer And use EXIT_SUCCESS And typedef void to nothing and use it in main
First one is immediately comprehensible, the second one is way too complex to be understood by just glancing at it. The converse would be true with different cases.
//////////////////////////////////////// // AddNumbers // param1 firstParam - The first value to add // param2 secondParam - The second value to add // return - The firstParam added to the secondParam