APS106H1 Midterm: APS106_2010_ts_1361545921

71 views7 pages

Document Summary

Examiners: c. beck, m. bussmann, d. nowak, v. sinnathurai circle the name of your instructor. Important: marks will be awarded for correctness of your algorithm, c syntax, adherence to recommended c coding practice, code efficiency, and the clarity of your program. This is a type c exam: closed book you may use a single aid sheet. #include int main() { int i = -1, j = 6; while (i++ <= j) { printf("%d %d\n", i, j /= 2); return 0; Note: int toupper(int c): if c is a lower- case letter, it returns the corresponding upper- case letter. If c isn"t a lower- case letter, it returns c unchanged. #include int main() { int i, j; for(i = 0; i < 2; ++i) { for(j = i; j < 3; ++j) printf("%d ", i * j); return 0;