C언어 처음 배우는 사람입니다.
수국
2023.04.01
질문 제목 : getchar()에 관한 질문,getchar()를 썼는데.. 프로그램이 바로 꺼지네요.질문 내용 : 다음은 제가 연습한 코드 내용입니다.
#include stdio.h
#include conio.h
int main(void)
{
int password;
printf(비밀번호를 입력하세요\n);
scanf(%d,&password);
if(password==12345)
{
printf(correct!\n);
}
if(password!=12345)
{
printf(wrong, please restart the program);
}
getchar();
}
뭐가 문제죠