| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 458 人关注过本帖
标题:輸出結果不是二進制??
取消只看楼主 加入收藏
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
快速回复:輸出結果不是二進制??
数据加载中...
 
   



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

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