8 votes
8 votes

Which of the following is an illegal array definition?

  1. Type COLONGE : (LIME, PINE, MUSK, MENTHOL);  var a : array [COLONGE] of REAL;
  2. var a : array [REAL] of REAL;
  3. var a : array [‘A’…’Z’] of REAL;
  4. var a : array [BOOLEAN] of REAL;

1 Answer

Best answer
17 votes
17 votes
Answer is b)

Array index must be integers. Enumerators, characters and boolean can be used in place of an integer but not real.
selected by
Answer:

Related questions

2 votes
2 votes
2 answers
1
go_editor asked Jun 13, 2016
4,277 views
In C, what is the effect of a negative number in a field width specifier?the values are displayed right justifiedthe values are displayed centeredthe values are displayed...
28 votes
28 votes
3 answers
2
Kathleen asked Sep 18, 2014
14,233 views
Consider the following C function:int f(int n) { static int i = 1; if(n >= 5) return n; n = n+i; i++; return f(n); }The value returned by $f(1)$ is:$5$$6$$7$$8$
30 votes
30 votes
4 answers
3
23 votes
23 votes
1 answer
4
Kathleen asked Oct 9, 2014
5,623 views
A critical section is a program segmentwhich should run in a certain amount of timewhich avoids deadlockswhere shared resources are accessedwhich must be enclosed by a pa...