#include <stdio.h>

int main() {
    // 배열 : 같은 자료형의 값을 하나의 이름으로 묶어서 저장하는 공간
    
    // 배열 선언
    // 자료형 배열이름[배열크기];
    int score[5];

    score[0] = 100;
    score[1] = 90;
    score[2] = 80;
    score[3] = 70;
    score[4] = 60;

    for (int i = 0; i < 5; i++) {
        printf("%d ", score[i]);
    }
    printf("\n");
    
    // 배열 한 번에 초기화
    int score2[] = {1, 2, 3, 4, 5};
    
    for (int i = 0; i < 5; i++) {
        printf("%d ", score2[i]);
    }
    printf("\n");
    


    
    return 0;
}

Embed on website

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