Electronics and Communication Engineering - Microprocessors

26.
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 =
1
- 1
+ 1.15
- 1.15
Answer: Option
Explanation:

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


27.
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
100
10
385
285
Answer: Option
Explanation:

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


28.
Which of the following arithmetic operations requires only one operand in FORTRAN 77?
Addition
Multiplication
Negative
Substraction
Answer: Option
Explanation:

All other operations require two operands.


29.
Which of the following is not a valid variable name in C?
p_ce1
1p_ce
p1_ce
p _ced
Answer: Option
Explanation:

First character is 1 which is not allowed.


30.
Which of the following array names is invalid in Fortran 77?
B(2, 4)
B(M, 3)
B(M, R)
B(3, 6)
Answer: Option
Explanation:

Subscript not proper.