CMPT 165 : CMPT165-VariablesReviewWithAnswers.docx

73 views2 pages

Document Summary

Variables review: what is the value of x after this code fragment runs? x = 0. 5 x = 1. 3. # x has the value 1. 3: what is the value of x after this code fragment runs? x = 3 y = 2. 5 x = y + 1. # x has the value 3. 5: what is the value of x after this code fragment runs? x = 14 x + 2. # x has the value 14: what is the value of x after this code fragment runs? x = 14 x + 2. # x has the value 14: what is the value of x after this code fragment runs? y = 11 x = y / 2. 0. # x has the value 5. 5: what is the value of x after this code fragment runs? y = 13 x = y % 5.