輸出結果不是二進制??
#include<stdlib.h>#include<stdio.h>
int main(){
long int decimalNumber,quotient;
int binaryNumber[100],i=1,j;
printf("Enter any decimal number: ");
scanf("%d",&decimalNumber);
quotient = decimalNumber;
if(quotient!=0){
binaryNumber[i++]= quotient % 2;
quotient = quotient / 2;
}
printf("Equivalent octal value of decimal number %d: ",decimalNumber);
for(j = i -1 ;j> 0;j--)
printf("%d",binaryNumber[j]);
system("pause");
return 0;
}
-----------------------------------------------------------------------
請各位幫忙看一下 為什麼輸出的結果不是二進制??
感謝各位高手的幫忙!!!