标题:輸出結果不是二進制??
取消只看楼主
slioplark
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2013-8-20
结帖率:100%
已结贴  问题点数:20 回复次数:0 
輸出結果不是二進制??
#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;
}

-----------------------------------------------------------------------
請各位幫忙看一下 為什麼輸出的結果不是二進制??
感謝各位高手的幫忙!!!
搜索更多相关主题的帖子: quotient include system number return 
2013-08-20 10:37



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-419397-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.015794 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved