Electronics and Communication Engineering - Microprocessors

31.
Which of the following conditional statements is not valid in Pascal?
If A > = B then B : = C + D + X
If (N = 45) THEN X : = X + 2 ELSEX : = 0
If A < = B then A : = C * D
If (A > = B) X : Y else X : = Z
Answer: Option
Explanation:

'then' is missing.


32.
A computer program is used to read N and compute N !. IF N = 6, the result will be
6
12
720
1040
Answer: Option
Explanation:

6! = 6 x 5 x 4 x 3 x 2 x 1 = 720.


33.
Consider the following statement in Basic

15 INPUT X, Y, Z
20 IF Y > X THEN 25
21 IF Z > Y THEN 30
25 PRINT Y
30 PRINT Z, X
35 END


IF X, Y, Z are 150, 200, 250 then the output will be
200, 250, 150 respectively
150, 200, 250 respectively
250, 200, 150 respectively
200, 150, 250 respectively
Answer: Option
Explanation:

In this case Y > X , so the control goes to 25. The output is Y , Z , X which are 200 , 250 , 150.


34.
The port of PC to which mouse is connected is called
serial port
parallel port
input port
scanner port
Answer: Option
Explanation:

Mouse is connected to serial port.


35.
FORTRAN expression for 3b2-5a2 is
SQRT (3 * B ** 2 - 5 * A ** 2)
SQRT 3 * B ** 2 - 5 * A ** 2
SQRT (3 * b ** 2 - 5 * a ** 2)
SQRT (3 * B ** 2) - SQRT (5 * A **2)
Answer: Option
Explanation:

It is the only expression with correct symbols.