C Programming MCQ

1:

Which of the following is an illegal array definition?

A.

Type COLOGNE:(LIME,PINE,MUSK,MENTHOL); var a:array[COLOGNE]of REAL;

B.

var a:array[REAL]of REAL;

C.

var a:array['A'..'Z']of REAL;

D.

var a:array[BOOLEAN]of REAL;

 

Answer : B

Explanation :

gayatri said: (2:16pm on Thursday 18th April 2013)
not able to understand....can u please explain??
chintan said: (3:15pm on Saturday 27th April 2013)
as per my perspective D is the right answer.
Mayank said: (7:00pm on Tuesday 7th May 2013)
only option B is array of continuous function. you can't make array of [real] of real nos. It does not have discrete elements so can't be indexed. so Given ans is right.
Surendra Kr. Sharma said: (4:06pm on Tuesday 6th October 2015)
Array indexes must be discrete, in option B [REAL] is continuous therefore it is illegal definition.

Write your comments here:


Report Error
 

Option: A

Explanation : Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here.