/*
제목: 변수 선언하기
기능: 변수 선언 및 초기화 + 정수형 변수 출력
파일이름: main.c
수정날짜: 2026. 07. 27
작성자: 백소윤
*/
// 숫자: 정수/실수
// int는 정수형 자료형
// 변수의 반대=상수
// c언어는 절차지향 언어 (코드 읽는 순서)
#include <stdio.h>
int main(void)
{
int num1, num2; // 2개의 변수 선언 -> 자료형 변수이름;
int num3=30, num4=40; // num3에 30대입, num4에 40대입 (초기화)
printf("num1: %d, num2: %d \n", num1, num2); // 변수 초기화 안한경우
num1=10;
num2=20;
printf("num1: %d, num2: %d \n", num1, num2);
printf("num3: %d, num4: %d \n", num3, num4);
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: