# Quiz - INT.TOSCI&ENG.COMP.Quiz#1 Name: 1.

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

Name: 09.03.2006 1. The correct definition of an integer variable called  total  initialized to zero, is (a) total : integer = 0; (b) total = 0, int; (c) int total =0; (d)int =0, total; 2. The statement that correctly assigns the sum of two variables  loop_count  and  petrol_cost  to the variable  sum  is (a) loop_count = sum + petrol_cost; (b) petrol_cost = sum – loop_count; (c) sum = petrol_cost / loop_count; (d) sum = loop_count + petrol_cost; 3. The correct statement which assign the decimal result of dividing the integer variable sum by 3 into the float variable costing, is (Use type casting to ensure that floating point division is performed) Given: int sum =7; floating costing; (a) float (costing) = sum / 3; (b) costing = (float) (sum / 3); (c) costing = (float) sum /3; (d) costing = float (sum / 3); 4.  The statement or statements which print(s) out the text string “ Welcome to C”, followed by a newline, is. (a) printf(“W elcome”);      printf(“to  C\n”);  (b) printf(“Wel come, \n”);      printf(“to  C\n”); (c) printf(Welcome\n to C\n); (d) printf(‘Welcome to C’,’\n ’ ); 5. 6. If x=1 and y=5, what does the expression, (x==1 || y==5) return?_____. 7. 8. If x=1 and y=5, what does the expression, (!(x==1) || y==5) return?_____. 9. 10.

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 11/22/2010 for the course CSE 104 taught by Professor E.t. during the Spring '09 term at Istanbul Technical University.

### Page1 / 3

Quiz - INT.TOSCI&ENG.COMP.Quiz#1 Name: 1.

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

View Full Document
Ask a homework question - tutors are online