#include <stdio.h>
int power(int);

 void main()
 {
  int n=10, c=0, s=0,m;
  m=n;
  while(n>0)
  {
   s=s+power(c)*n%2;
   c++;
   n=n/2;
  }

  printf("%d는 이진수로 %d 입니다\n",m,s);
 }

int power(int n)
{
 if (n==0) return 1;
 
 int result=1;
 int i;
 for(i=1; i<=n; i++)
 {
  result = result * 10;
 }

 return result;
}




2진수 값이 0이라고만 뜨는데 뭐가 틀린걸까요??