CS1080202a - Computer Science Foundation Exam August 2 2002 COMPUTER SCIENCE I Section I A No Calculators KEY Name SSN Score 50 In this section of

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Computer Science Foundation Exam August 2, 2002 COMPUTER SCIENCE I Section I A No Calculators! Name: SSN: Score: In this section of the exam, there are four (4) problems You must do all of them. The weight of each problem in this section is indicated with the problem. The algorithms in this exam are written in C programming language notation. Partial credit cannot be given unless all work is shown. As always, be complete, yet concise, and above all be neat . Credit cannot be given when your results are unreadable. KEY / 50
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
1. (10 points) What is the exact output from the following program? Output is: #include <stdio.h> int q1 (int *, int, int *); int main ( ) { int a = 3; int b = 15; int *c; c = &b; a = q1(&a, b, c); printf(“2. a = %d, b = %d, *c = %d\n”, a, b, *c); return 0; } int q1 (int *x, int y, int *z){ int a = 7; int *p; printf(“1. *x = %d, y = %d, *z = %d\n”, *x, y, *z); p = z; *p = a + *x; return (*x + *z + y); } 1. *x = 3, y = 15, *z = 15 2. a = 28, b = 10, *c = 10
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 09/21/2011.

Page1 / 5

CS1080202a - Computer Science Foundation Exam August 2 2002 COMPUTER SCIENCE I Section I A No Calculators KEY Name SSN Score 50 In this section of

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online