Home > Back-end > Enter a binary number, the output of its 16 bit binary number.
Enter a binary number, the output of its 16 bit binary number.
Time:09-28
Subject is a binary number input, the output of its 16 bit binary number, the code on the DEV run perfect, but an error on the platform of school homework is invalid memory references, strives for the big show where there is a problem, #include Int main () {int n, I, j, k; Static int a, [16]. The scanf (" % d ", & amp; N); for(i=1; I<=16; I++) {a [I]=n % 2; K=n/2; N=k; } For (j=16; J> 0; J -) Printf (" % d ", a [j]); If (j==1) printf (" \ n "); }
CodePudding user response:
What do you mean? Enter a binary number, the output is a binary number??????
CodePudding user response:
You first make sure the array [16] a subscript from what to what end, should be from 0 to 15, but you use the 16, an array