How do you declare a two-dimensional array of integers with 3 rows and 4 columns?
- int arr[12];
- int arr[3][4];
- int arr[4][3];
- int arr[][];
To declare a 2D array in C with 3 rows and 4 columns, you use the syntax: int arr[3][4]; The first dimension specifies the number of rows, and the second dimension specifies the number of columns.
Loading...
Related Quiz
- You're developing a function that modifies an array of integers. To ensure that the original array is not altered, how should the array be passed to the function?
- What is the purpose of the 'switch' statement in C?
- To check for errors during file operations, you can use the ______ function.
- When a pointer is incremented, it moves to the memory address of the next element based on the ________ of the data type it points to.
- In C, a string is essentially an array of ________ terminated by a null character.