exam1_solution

exam1_solution - Solution Name ECE264 Advanced C...

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

View Full Document Right Arrow Icon
S o l u t i o n February 28, 2008 Name _________________________________ ECE264 Advanced C Programming Exam 1 Solve the following problems. The number of points for each problem is shown next to the prob- lem and in the table below. The outcomes corresponding to each question are also shown. Use only the space provided to solve each problem. Problem Points Outcome iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii 1 (a) / 5 (b) / 5 (c) / 10 (d) / 10 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii 2 / 30 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii 3 (a) / 10 2 (b) / 10 (c) / 10 (d) / 10 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii Total / 100 c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c
Background image of page 1

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

View Full DocumentRight Arrow Icon
- 2 - Problem 1 (30 points) Specify what the following program will print in each one of the calls to the function printarray(). Note that there are four calls, marked (a), (b), (c) and (d). #include <stdio.h> #define NA 7 int main() { int a[NA]={7,5,4,2,6,3,1},i; void printarray(int *, int),arrayfunc(int *, int); printarray(a,NA); /* (a) */ printarray(a+2,NA-2); /* (b) */ arrayfunc(a+2,NA-2); printarray(a,NA); /* (c) */ arrayfunc(a,NA); printarray(a,NA); /* (d) */ printf("\n"); } void printarray(int b[], int size) { int i; printf("\n");
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 note was uploaded on 04/17/2008 for the course ECE 264 taught by Professor Pomeritz during the Spring '08 term at Purdue.

Page1 / 8

exam1_solution - Solution Name ECE264 Advanced C...

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