Answers for "arrays print 2d"

3

print 2d array in java

int[][] array = new int[rows][columns];
System.out.println(Arrays.deepToString(array));
Posted by: Guest on October-24-2020
0

print 2d array c++

for( auto &row : arr) {
    for(auto col : row)
         cout << col << " ";
	cout<<endl; 
}
Posted by: Guest on April-04-2021
0

C print 2D array

#include <stdio.h>

#define MAX 10

int main()
{
    char grid[MAX][MAX];
    int i,j,row,col;

    printf("Please enter your grid size: ");
    scanf("%d %d", &row, &col);


    for (i = 0; i < row; i++) {
        for (j = 0; j < col; j++) {
            grid[i][j] = '.';
            printf("%c ", grid[i][j]);
        }
        printf("\n");
    }

    return 0;
}
Posted by: Guest on April-16-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language