강의

멘토링

커뮤니티

Inflearn Community Q&A

donghyun93054523's profile image
donghyun93054523

asked

Learn C Programming by Following Along with Hong Jeong-mo

2.5 How to declare variables

변수 초기화

Written on

·

321

0

만약

int x,y,z=0;

이렇게 입력하면 z만 0으로 초기화 되는건가요?? 아님 x,y,z 셋 다 모두 0으로 초기화되는건가요??

c

Answer 1

0

z가 0으로 초기화됩니다.

printf 등으로 출력해보면 확인할 수 있는데요,

아래 코드를 실행하여 확인해보시기 바랍니다.

#include <stdio.h>


int main(){
	int a, b, c = 100;
	printf("%d %d %d", a, b, c);
	return 0;
}
donghyun93054523's profile image
donghyun93054523

asked

Ask a question