#include <stdio.h>

int main() {
    int a[2][10];
    // 2개의 배열을 한 배열을 생성하고 그 배열 안에 10개의 숫자가 들어갈수 있게 생성
    int b[2][3] = {
        {10, 20, 30},
        {100, 200, 300}
    };
    // 2차원 배열안에 숫자를 넣을때
    printf("==================\n");
    for(int c=0;c<2;c++){
        for(int d=0;d<3;d++){
            printf("[%d], [%d] = %d\n", c, d, b[c][d]);
        }
        printf("==================\n");
        // for문으로 출력 할때 코드
    }
}
// 3차원, 4차원 배열등도 위 처럼 할 수 있음!

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: