|
|
1. | What will be the result of the expression a % b when a and b are of type int and their values are a = 10 and b = 6? | |
Hint
Half-n-half Clue
| | |
2. | In which of the following code fragments, is the variable x evaluated to 8? (A) int x = 32; x = x>>2; (B) int x = 33; x = x>>2; (C) int x = 35; x = x>>2; (D) int x = 16; x = x>>1; | | Half-n-half Clue
| | |
3. | Given the declarations int x , m = 2000; short y; byte b1 = -40, b2; long n; Which of the following assignment statements will evaluate correctly? (A) x = m * b1; (B) y = m * b1; (C) n = m * 3L; (D) x = m * 3L; | | Half-n-half Clue
| | |
4. | Identify the statements that are correct: (A) int a = 13, a>>2 = 3 (B) int b = -8, b>>1 = -4 (C) int a = 13, a>>>2 = 3 (D) int b = -8, b>>>1 = -4 | | Half-n-half Clue
| | |
5. | Which of the following is not a hexadecimal number? (A) 999 (B) (hex)23 (C) 0x556 (D) 0x1F2 | | Half-n-half Clue
| | |
6. | Consider the following code: int x, y, z; y = 1; z = 5; x = 0 - (++y) + z++; After execution of this, what will be the values of x, y and z? | | Half-n-half Clue
| | |
7. | In the code below, what data types the variable x can have? byte b1 = 5; byte b2 = 10; x = b1 * b2;(A) byte (B) int (C) short (D) long (E) float (F) double | | Half-n-half Clue
| | |
| |
|
|