Quiz de C: 2D Arrays

This C quiz is about arrays of arrays, the usual way to store grids and matrices. It checks indexing with two subscripts, how initializers fill rows, how sizeof sees rows and columns, and how to pass a 2D array to a function.

Médio 10 perguntas ~6 minutos Aprovação com 80% C17

Escolha um modo

Jogando como visitante: entre para guardar seu XP e sua sequência.

Pergunta de exemplo

Pergunta 1 de 10

What does this print?

#include <stdio.h>

int main(void) {
    int m[2][3] = {{1, 2, 3}, {4, 5, 6}};
    printf("%d %d\n", m[1][2], m[0][1]);
    return 0;
}
Mostrar a resposta

A. 6 2 The first index picks the row and the second the column, both from 0. m[1][2] is the last item of the second row, 6, and m[0][1] is the middle of the first row, 2.

O que este quiz cobre

  • m[row][col] indexing and nested loops
  • Row-by-row initializers and the zero fill
  • Counting rows and columns with sizeof
  • Which dimension can be left out
  • Row-major layout and function parameters

Perguntas frequentes

Preciso de uma conta?

Não. Qualquer pessoa pode jogar. Entre para guardar seu XP, sequência, badges e histórico.

Posso refazer?

Pode. Sua melhor nota fica salva, e as perguntas e respostas são embaralhadas a cada vez.