Exercise: Microprocessors

Questions for: Microprocessors

A computer program is used to read N and print the sum 12 + 22 + 32 +.....+ N2. If N = 10, the print out will show the number
A:
100
B:
10
C:
385
D:
285
Answer: C

SUM = 12 + 22 + 33 + 44 + 52 + 62 + 77 + 82 + 92 + 102 = 385.

Consider the following program in C

int k;
float a, b, c;
k = a* b* c / 100 + 2.5 / 2 - 0.3 * 9


if a - 5.0, b = 2.0 and c = 3.0 the final result k =
A:
1
B:
- 1
C:
+ 1.15
D:
- 1.15
Answer: B

k = 0 + 1 - 2 = - 1 because k is an integer.

A microprocessor is generally
A:
single chip SSI
B:
single chip MSI
C:
single chip LSI
D:
any of the above
Answer: C

It is LSI chip.

Consider the following statements about Java variables
  1. Java variable must start with a letter or underscore or dollor sign.
  2. Java variable can not start with a digit.
  3. After the first character the variable can have any combination of letters or numbers.
  4. Capitalization of letters must be consistent.
Which of the above are correct?
A:
All
B:
1, 2 and 3 only
C:
2, 3, 4 only
D:
1, 2 and 4 only
Answer: A

All these are correct for Java variables.

Consider the following program in Basic

5 READ R
10 D = 2 * R
20 A = 3.1416 * D * D / 4
30 PRINT A

Assuming that R = 3.0, the output A =
A:
2.827
B:
28.27
C:
282.7
D:
2827
Answer: B

.

Ad Slot (Above Pagination)
Quiz