{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# midtermF98 - EGN 3210 pre test 1 Fall 1998 Some sample...

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

EGN 3210 pre test 1 Fall 1998 Some sample problems. The test will include ch. 1 to 4. All of the sample problems are from ch 3 and 4. Ch 1 to 2 are more traditional where you are better off just reading the book. Solutions will be posted on Monday. What is the output of each code segment, Assume variables are declared: For (x = 1; x < 4; x++) printf("X = %d, ",x); For (x = 5; x <= 25; x = x + 5) printf("X = %d, ",x); For (x = 10; x >0; x--) printf("X = %d, ",x); For (x = 0,y = 0; x < 3; y++,x++) printf("X = %d, ",x+y); For (x = 0,y = 10; x < 3 & y > 6; y--,x++) printf("X = %d, ",x+y); For (x = 1; x < 3; x++) For (y = 1; y < 3; y++) printf("X = %d,Y = %d, ",x,y); For (x = 1; x < 3; x++) For (y = 1; y < 3; y++) printf("X *Y= %d, ",x*y); For (x = 1; x < 8; x++) printf("X = %d, ",x++); x = 36; if (x == 37) print("Yes"); else print("No");

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

View Full Document
x = 36; y = 45; print("Yes"); else print("No"); x = 37; y = 45; if (x == 37 || y == 42) print("Yes"); else print("No"); x = 37; y = 42;
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 5

midtermF98 - EGN 3210 pre test 1 Fall 1998 Some sample...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online