pastexam1

Pastexam1 - Exam 1 ECS 102 Dr Baruch Spring 2006 Name No calculators problem points score 1 12 2 5 3 6 4 3 5 6 6 3 7 12 8 8 9 10 10 5 11 9 12 15 13

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Exam 1 ECS 102 Dr. Baruch Spring 2006 Name: No calculators. problem points score 1 12 2 5 3 6 4 3 5 6 6 3 7 12 8 8 9 10 10 5 11 9 12 15 13 6 Total 100 1 1. Evaluate as a computer would (a) floor(6.9) (b) ceil(6.9) (c) 17%5 (d) 17 / 5 (e) pow(6,2) (f) 20 .- 3 . * 4 . 2. Write a C expression that could be used for computing the following expression: a = x 2- 1 e 2 + 3- | x + 3 | 3. Circle any invalid variable names. (a) luv2sing (b) star**struck (c) main (d) 2ndBase (e) TimeTravel (f) on the hill 4. Write a preprocessor directive for a constant INCH PER YD with value 36. 2 5. Answer the questions about this code segment. The data entered at the keyboard are s t u v double a,b; int x; char m, k, n, p; a=1.1; b=3*a; x = (int)a; (int) b; printf("Enter four letters: "); scanf("%c%c %c %c", &p, &k, &m, &n); printf("a is %lf,\n b is %lf,\n x is %d",a, b, x); (a) What will be the memory for each variable, from beginning to end? (Cross out old values.) (b) What will we see on the monitor? (From the beginning.) Use t to indicate each space....
View Full Document

This note was uploaded on 04/24/2008 for the course ECS 102 taught by Professor Baruch during the Fall '06 term at Syracuse.

Page1 / 8

Pastexam1 - Exam 1 ECS 102 Dr Baruch Spring 2006 Name No calculators problem points score 1 12 2 5 3 6 4 3 5 6 6 3 7 12 8 8 9 10 10 5 11 9 12 15 13

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online