Which of the following does not declare a 2-by-2 array and set all four of its elements to 0?

a. int b [ 2 ][ 2 ];
b[ 0 ][ 0 ] = b[ 0 ][ 1 ] = b[ 1 ][ 0] = b[ 1 ][ 1 ] = 0;
b. int b[ 2 ][ 2 ] = { 0 };
c. int b[ 2 ][ 2 ];
for ( int i = 0; i < 2; i++ )
for ( int j = 0; j < 2; j++ )
b[ i ][ j ] = 0;
d. All of the above initialize all four of the array elements to 0.


d. All of the above initialize all four of the array elements to 0.

Computer Science & Information Technology

You might also like to view...

Which interface is specifically intended to be implemented by classes that can be used with the try-with-resources statement?

a. Comparable b. Runnable c. AutoCloseable d. Serializable

Computer Science & Information Technology

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

1. Any code that helps the data-entry person remember how to enter the data or the end-user remember how to use the information can be considered an alphabetic derivation code. 2. Unicode is used to represent glyph or syllables or whole words. 3. If codes must be long, they should be broken up into sub codes. 4. The code abbreviations in a mnemonic system must be frequently changed.

Computer Science & Information Technology

(Drawing Patterns with Nested for Loops) Write a program that uses for statements to print the following patterns separately, one below the other. Use for loops to generate the patterns. All asterisks (*) should be printed by a single statement of the form cout << '*'; (this causes the asterisks to print side by side). [Hint: The last two patterns require that each line begin with an ap- propriate number of blanks. Extra credit: Combine your code from the four separate problems into a single program that prints all four patterns side by side by making clever use of nested for loops.]


What will be an ideal response?

Computer Science & Information Technology

Which of the following RAM modules has a PC rating of 10600?

A. DDR B. SDRAM C. DDR3 D. DDR2

Computer Science & Information Technology