所屬科目:研究所、轉學考(插大)、學士後-計算機概論
1. Consider a base n number system and an associated expression shown below. (a) n = ? (b) x = ?(c) y = ? (15%)
2. Consider the following floating-point representation. Suppose that the exponent is stored using Excess-127 representation. (a) What is the maximal number that can be represented using this format? (b) What is the minimal positive number that can be represented using this format?(20%)
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%)
5. Write a C function named fun1 that accepts an integer parameter n and prints all integers from 1 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%)