CSCI 103L Midterm: CS 103 USC cs103 s15 Mid

192 views10 pages
31 Jan 2019
School
Course
Professor

Document Summary

For this exam, you are allowed to use a one-sided cheatsheet (8. 5 x11 ) written in your own handwriting. Most of the programs inside omit their #include and using statements and the declara- tion/return from main. Print your name, print your email address, and select your lecture section now. * problem 0: ll out this cover page. If it would not compile, write x in both boxes. 2 short programs (6 points) (a) what is the output of the following program? int i; for (i=0; i<5; i++) { 1: int roll() { return rand() % 6 + 1; } Describe each one and how to x it (be brief, try to use at most. Each x is a simple change on a single line. (a) when we try to compile the program it gives us a scope error. To x this error: (b) after xing this, the program runs, but always prints even 0 small 0.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers

Related Documents