negative decimal to binary c code
<p>I can't write negative decimal to binary c code.
need help :)
Here is my code......
There is no need other includes.</p>

<pre><code>#include &lt;stdio.h&gt;

    int main(void){
        int i;
        int j;
        int b[16];
        printf("input number");
        scanf("%d",&amp;i);
        if(i &lt;= 0) {
            // here is negative decimal code
        } else {
            for(j=15;j&gt;=0;j--) {
                b[j] = i % 2;
                i = i / 2;
            }
            for (j=0;j&lt;=15;j++)
                printf("%d", b[j]);
            printf("\n");
        }
        return 0;
    }
</code></pre>