#include <stdio.h>
#include <math.h>
/* converts to binary */
int main()
{
unsigned int decimalNUM = 0;
printf("Enter a number to be converted to binary.\t");
scanf("%d", &decimalNUM);
fflush(stdin);
baseConv(decimalNUM);
getchar();
return 0;
}
baseConv(unsigned int n){
if (n == 0) ;
while (n > 0){
printf("%d", n%2);
n = n >> 1;
}
return 0;
}
我现在知道该怎么做,但它会向后打印。我将如何扭转它?