1. 2D array creation
#include <stdio.h>
#include <stdlib.h>

int main()
{

	int nums[3][2] = {
									{1, 2},
									{3, 4},
									{5, 6}
									};

// 2 brackets. Each meaning row, column of the array//

	printf("%d", nums[0][0]); // 1 //
	printf("%d", nums[1][1]); // 4 //

		return 0;
}

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/f1be94e5-2779-495b-bf9c-2e4b0075c3f2/Untitled.png

아래와 같은 방법도 가능

#include <stdio.h>
#include <stdlib.h>

int main()
{

	int nums[3][2] ;
	num[0][0] = 0;
	num[0][1] = 1;
	num[1][0] = 2;
	.
	.
	.
	// make the full array each by element //

		return 0;
}
  1. Nested for loop

Loop within a loop

#include <stdio.h>
#include <stdlib.h>

int main()
{

	int nums[3][2] = {
									{1, 2},
									{3, 4},
									{5, 6}
									};

	int i, j;
	for(i = 0; i < 3; i++){
			for(j = 0; j < 2; j++){
					printf("%d", nums[i][j]);
			}
			printf("\\n");
	}

		return 0;
}

nums의 모든 element를 출력.

매 row마다 column 순서대로 출력.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/aaa3093b-c23a-49b8-92e7-095c71ff6eeb/Untitled.png