ex1KEY - COP 3502 Exam #1 Summer 2002 KEY NAME: June 10,...

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

View Full Document Right Arrow Icon
1. (12 points – 2 pts/answer) What is the exact output from the following program? Output is: 2. (6 points – 2 points each) 1 COP 3502 – Exam #1 – Summer 2002 NAME: June 10, 2002 (100 points) #include <stdio.h> int q1 (int *, int, int *); int main ( ) { int a= 4; int b = 17; 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 = 5; 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 = 4, y = 17, *z = 17 2. a = 30, b = 9, *c = 9 READ THIS! READ THIS! READ THIS! No calculators may be used on this exam. Place your answers in the boxes. Use other blank areas to shown your work. Show all of your work on every problem. KEY
Background image of page 1

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

View Full DocumentRight Arrow Icon
For the function shown below, show the value returned by the function for each of the three function calls (a) – (c). (a) Call: q2(425) Value returned is: (b) Call: q2(872) value returned is: (c) What is the task implemented by this function? 3. (15 points – 5 points each) Answer each of the following questions. Be sure to show your work. (a) What is the decimal equivalent to the binary number: 10011101 answer: (b) What is the binary equivalent to the decimal number: 79 answer: (c) Solve for x in this equation : log (x-1) 1024 = 5 4. (12 points – 3 points each answer) 2 157 since,
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 06/12/2011.

Page1 / 6

ex1KEY - COP 3502 Exam #1 Summer 2002 KEY NAME: June 10,...

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