• 2021-04-14
    下面程序是将十进制数转换成不超过十六进制的n进制。请分析程序填空。 #include main() { int i=0,base,n,j,num[20]; printf("Enter data that will be converted:\n"); scanf("%d",&n); printf("Enter base:\n"); scanf("%d",&base); do { i++; num[i]=n【1】base; n=n【2】base; } while(n); printf("The data %d has been converted into the %d base data:\n",n,base); for(【3】) if(num[j]>9) putchar(num[j]+'A'-10); else putchar(num[j]+'0'); }