C语言-十进制转换为二进制

/*Decimel is changed Binary*/
#include<stdio.h>
#include<stdlib.h>
int main(){
	int num,arrys[100000],i=0,j;//Please attention the arrys,which should be bigger//
	printf("Please input integer\n");
	scanf("%d",&num);
	while(num>0){
		arrys[i]=num%2;
		i++;
		num=num/2;
	}
	for(j=i-1;j>=0;j--)
	printf("%d\t",arrys[j]);
	system("pause");
	return 0;
	
} 
发布了16 篇原创文章 · 获赞 0 · 访问量 1573

猜你喜欢

转载自blog.csdn.net/weixin_45713352/article/details/104554979
今日推荐