CMPT 127 Lecture Notes - Lecture 1: Software Engineering

123 views1 pages

Document Summary

Reading the first 8 lines of code top-to-bottom, left-to-right, we see: Line 1: a comment describing what the following function does. Lines 2-8 are the function definition, as follows: The result, or return value of running this function is of type int. The function takes two integer arguments called x and y. The body of the function, i. e. the code that will execute when the function is called, starts at { In the body of the function, the keyword return evaluates the expression to it"s right which becomes the function"s return value, then exits the function. The body of the function ends at the closing }. Having been defined in lines 2 to 8, function max() is called on line 15. The values of integers a and b are assigned to x and y inside max(), the function does its work, and the return value is passed as the second argument to printf().

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents

Related Questions