Docsity

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

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