Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Input a positive integer from the keyboard to the integer variable A, and output a binary number.
Input a positive integer from the keyboard to the integer variable A, and output a binary number.
int main()

{

int n,I;

int a[32];

scanf("%d ",n);

I =- 1;

And (n! =0)

{

i++;

a[I]= n % 2;

n = n/2;

}

for(; I>- 1; I-)

printf("%d ",a[I]);

Returns 0;

}