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 =

A. 1
B. - 1
C. + 1.15
D. - 1.15

Answer: Option B

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

A. 100
B. 10
C. 385
D. 285

Answer: Option C

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?

A. Addition
B. Multiplication
C. Negative
D. Substraction

Answer: Option C

Explanation:

All other operations require two operands.


29. 

Which of the following is not a valid variable name in C?

A. p_ce1
B. 1p_ce
C. p1_ce
D. p _ced

Answer: Option B

Explanation:

First character is 1 which is not allowed.


30. 

Which of the following array names is invalid in Fortran 77?

A. B(2, 4)
B. B(M, 3)
C. B(M, R)
D. B(3, 6)

Answer: Option C

Explanation:

Subscript not proper.