ECE 220
Midterm (B)
March 11th, 2026, 1:00PM
Name:
Student ID:
Signature:
Instructions
• PRINT YOUR NAME and Student ID into the boxes above.
• Sign in the Signature box.
• Write your name and your Student ID on the General Purpose Answer Sheet. Your
Student ID should be left-aligned, e.g.
• Fill in the bubbles on the General Purpose Answer Sheet to code in your name and ID.
• Write 010000 in Special Code on the General Purpose Answer Sheet.
• This is a CLOSED BOOK exam. Time allowed: 50 minutes.
• Calculators, cell phones, or computers of any kind are not permitted.
• This exam, worth 90 points, counts 15% toward your final grade in this course.
• Write your answers properly on the answer sheet with an HB pencil. If the optical reader
cannot clearly read your answer, the mark on that question will be 0.
• All the C code provided in this exam is ANSI standard and uses the ASCII character set.
• For questions regarding code fragments, assume that all the necessary header files
and surrounding code are provided.
• Questions are weighted differently in each part: Points
o Part 1 - (5 questions at 3 point each) 15
o Part 2 - (5 questions at 5 points each) 25
o Part 3 - (5 questions at 6 points each) 30
o Part 4 - (2 questions at 10 points each) 20
• This question booklet must be returned with your General Purpose Answer Sheet for
you to get credit for this exam.
• IMPORTANT: Answer Parts 1, 2 and 3 in the General Purpose Answer Sheet. For
Part 4 use the space provided in this booklet.
page 1 of 11
, ECE220 – Programming for Electrical Engineering
Part 1: [15 points total – 5 Questions – 3 points each] – Multiple Choice Questions
Answer the following questions starting at question number 1 on the front of your General
Purpose Answer Sheet]
3. Which of the following correctly declares (is a prototype) a function that takes a pointer to
integer and returns an integer?
a) int fun(int);
b) int * fun(int *);
c) void fun(int *);
d) int fun(int *);
e) char = fun(int);
2. What is the value of *(arr+2) of the following array?
int arr[4] = {5, 10, 15, 20};
a) 5
b) 10
c) 15
d) 20
e) address of arr[2]
1. What is the output produced by the following code?
int x = 4, y = 7;
int *p;
p = &x;
*p = y + 1;
printf("%d %d\n", x, y);
a) 4 7
b) 5 7
c) 7 8
d) 8 8
e) 8 7
page 2 of 11