title: Wrong outputs in Decimal to binary conversion after input of 1024?
body: <p>My code works fine till 1024, but bigger values than 1024 gives wrong output, please help:</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  
  int main()
  {
      int dec,i=1;
      int rem=0;
      long long int result=0;
  
      scanf("%d",&amp;dec);
  
      while(dec!=0)
      {
          rem=dec%2;
          result = result +rem*i;
  
          dec=dec/2;
          i=i*10;
  
      }
      printf("%I64u",result);
  
      return 0;
  }
  </code></pre>