ginachuquiano8635 ginachuquiano8635
  • 25-01-2024
  • Computers and Technology
contestada

What does the following code snippet do?
int a[3][3]; // declare 2D array
for (int i = 0; i < 3; ++i) {
for (int j = 0; j < 3; ++j) {
if (i == j) a[i][j] = 1;
}
}
a) Initializes a 2D array with ones on the diagonal
b) Initializes a 2D array with zeros on the diagonal
c) Sets all elements of the array to 1
d) Generates a compilation error

Respuesta :

Otras preguntas

Scientific laws and theories cannot change. They are absolute fact. True or false?
Emma is debating whether to use a straightedge and compass or a computer drawing program to complete a construction of a square inscribed in a circle. Which met
A student compares two different proteins. The student notices that the primary structures differ in both the number of amino acids and the sequence of amino ac
why do some people sneeze when in sunlight?
Is new york city a rural,urban or suburban community?explain
examples if imagery in john muir's essay calypso borealis
What cells express different genes, what occurs? A. Cell reproduction B. Morphogenesis C. Cell differentiation C. Apoptosis
help! ill give u brainiest answer
What is 20.6 divided by 9.7? (Include remainder)
how do you write 31/50 as a percentage7k