// 변수: 변하는 수
// 선언된 위치에 따라서 지역변수/전역변수
// 지역변수: {} 내부에서 선언된 변수
// 전역(전체지역)변수: {} 외부에 선언된 변수
// 범위: 전역>지역

#include <stdio.h>
int total; // 전역변수

int f(){
    int sum=0; // 지역변수
    printf("hello");
}

int main() {
    int num=0; // 지역변수
    scanf("%d", &num);
    printf("Hello world!\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: