

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


ECS 30A Practice Midterm # Hanly and Koffman, 5ed, Chapters 2-5, Closed book and closed notes.
if (X > 20) printf(“First ”); else if(X < 5) printf(“Second “); else printf(“Third “); if(X == 20) printf(“Fourth “); else if(X < 19 || X > 25) printf(“Fifth “); if(X > 5 && X < 22) printf(“Sixth ”);
a. (5 points) X = 0 ________________________________________________________________________
b. (5 points) X = 5 ________________________________________________________________________
c. (5 points) X = 17 ________________________________________________________________________
d. (5 points) X = 20 ________________________________________________________________________
e. (5 points) X = 28 ________________________________________________________________________
b.) w = x-- + y-- * ++z ___________________________________
c.) w = x == y || x != y && z > x ___________________________________
d.) w = !!(x * 4) + x % y ___________________________________
e.) w = 7 * --y + !(y ==5) ___________________________________
Please enter two positive integers: 20 12 1 2 4
Please enter two positive integers: 60 120 1 2 3 4 5 6 10 12 15 20 30 60
Please enter two positive integers: 8 9 1
Please enter two positive integers: 0 230 Done.