所屬科目:研究所、轉學考(插大)、學士後-計算機概論
1. Consider a base n number system and an associated expression shown below. (a) n = ? (b) x = ?(c) y = ? (15%)123+ 4322431x4 y
2. Consider the following floating-point representation. Suppose that the exponent is stored usingExcess-127 representation. (a) What is the maximal number that can be represented using thisformat? (b) What is the minimal positive number that can be represented using this format?(20%)1 8 23S Exponent MantissaSign
3. Suppose that we have the following macro definition in C.#define CIRCLE_AREA( x ) (4 * x * x )What will be the value of area when executing the following statement with c = 3? (15%)area = CIRCLE_AREA( c + 2 );
4. What will be the output of the following C program? (15%)s = 0;for (i = 0; i <= 10; i++) {if (i % 2 == 1)continue;for (j = 1; j < i; j++) {if (i * j > 50)break;s = s + j;}}frintf (“%d”, s);
5. Write a C function named fun1 that accepts an integer parameter n and prints all integers from1 to n that are not the multiplier of either 3 or 5. (20%)
6. Suppose that the ASCII codes for ‘A’ to ‘Z’ are from (41) 16 to (5A) 16 and the ASCII codes for‘a’ to ‘z’ are from (61) 16 ~ (7A) 16 . Assume that character variable ch stores a lower-case letter.Write a logic expression that applies AND, OR, or NOT to ch to capitalize it (converting ‘a’ to‘A’, ‘b’ to ‘B’, and so on). (15%)