Electronics and Communication Engineering - Microprocessors

36.
If J = 12 and X = 24.4 the result of the following FORTRAN 77 program will be

READ *, J, X
K = J ** 2
Z = 3 * X
Print *, J, K, Z
12, 144, 73.2
15.0, 144.0, 73.2
15.0, 144.0, 73
15. 144. 73
Answer: Option
Explanation:

J = 12, K = 122 = 144, Z = 3 x 24.4 = 73.2 In the result J and K will be without decimal point.


37.
Consider the following about 'arrays' in C
  1. An array is a collection of similar elements.
  2. An array can not have 10 numbers 5 of which are ints and 5 are floats.
  3. An array can have ints and chars in the same array.
Which of the above are correct?
All
1 and 2 only
1 and 3 only
2 and 3 only
Answer: Option
Explanation:

An array can have all int or all floats or all chars.


38.
A computer program is used to read M and print the sum 2 + 4 + 6 + 8 +.........+ 2M. If M = 9 , the print out will show the number
9
18
90
100
Answer: Option
Explanation:

SUM = 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 = 90.


39.
Read the following rules for scanning Boolean expressions in Pascal
  1. The expressions are scanned from left to right.
  2. The operations are scanned in the order NOT, AND, OR.
  3. All operators (i.e., NOT, AND and OR) are scanned together.
  4. In one scanning all the operators of only one type are scanned.
Which of the above are correct?
All
1, 2 and 3 only
1, 2 and 4 only
2, 3 and 4 only
Answer: Option
Explanation:

All Boolean operators are not scanned together. The order is NOT, AND, OR.


40.
IC 74181 performs arithmetic operations when M = 1.
True
False
Answer: Option
Explanation:

When M = 1, IC 74181 performs logic operations.