Find the error(s) in each of the following statements:

a) Assume that: int a[ 3 ];
cout << a[ 1 ] << " " << a[ 2 ] << " " << a[ 3 ] << endl;
b) double f[ 3 ] = { 1.1, 10.01, 100.001, 1000.0001 };
c) Assume that: double d[ 2 ][ 10 ];
d[ 1, 9 ] = 2.345;


a) ```
a[ 3 ] is not a valid location in the array. a[ 2 ] is the last valid location.
```
b) ```
Too many initializers in the initializer list. Only 1, 2, or 3 values may be provided in the initializer list.
```
c) Incorrect syntax array element access. d[ 1 ][ 9 ] is the correct syntax.

Computer Science & Information Technology

You might also like to view...

Answer the following statements true (T) or false (F)

1. When the keyword void appears in the method header, it means the method will return a value. 2. When a method is declared with the private access modifier, it can be called only by code inside the same class as the method. 3. In general, the same naming rules that apply to variables also apply to methods. 4. In a method header, the name is always followed by a set of parentheses.

Computer Science & Information Technology

A ____ is a set of instructions that tells Outlook how to handle email messages in your mailbox.

A. server B. password C. domain D. rule

Computer Science & Information Technology

Which of the following is NOT a language used to develop Web Applications?

A. Java B. Hypertext Markup Language C. Javascript D. Cascading Style Sheets

Computer Science & Information Technology

The Excel operator for "not equal to" is:

A) < > B) >= C) <= D) !=

Computer Science & Information Technology