이번에도 또 오류가 나오네요
10진수를 2진수로 고치는 문제인데
#includestdio.h
#includeconio.h
int main(void)
{
int answer[100];
int count=0,n,i;
scanf(%d,&n);
while(n!=0)
{
answer[count]=n%2;
n=n/2;
count++;
}
for(i=count-1;i=0;i--)
{printf(%d,answer[count]);}
getch();
return 0;
}
오류가 어디서 난 걸까요??
실행은 되는데 1을 입력하니 247924 머 이런 식으로
랜덤한 숫자가 뜨던데요;;;
댓글 0