Final Exam with Solution - Computer Programs | COMPE 160, Exams of Engineering

Material Type: Exam; Professor: Marino; Class: INTRO TO COMPUTER PROG; Subject: Computer Engineering; University: San Diego State University; Term: Spring 2010;

Typology: Exams

2012/2013

Uploaded on 02/19/2013

misao-maki
misao-maki 🇺🇸

5

(1)

13 documents

1 / 8

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
pf3
pf4
pf5
pf8

Partial preview of the text

Download Final Exam with Solution - Computer Programs | COMPE 160 and more Exams Engineering in PDF only on Docsity!

CompE160 Introduction to Programming Marino CompE160 Final Exam Name Dr, ZL u“ tt ge Student ID Closed book 4. Read the following program and answer the question that follows. #include main{) { int.i, n= 0; i=; 7 while (i <= 10) Zee { Brio if (i $ 2 == 0) n n+ if + eo dei : } printf("n = $d\n", nj; } Question What will be printed when this program executes? Answer n= BO 2, Read the following program and answer the question that follows. #include #define SIZE 10 main(} { int i, n; int x(SIZE] = (7, -13, 8, 43, 34, -25, 19, 37, 0, -19}; n= x[0]; for (i=0; i