Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Write a program in C language to output the binary form of an unsigned integer variable value. (Please help me)
Write a program in C language to output the binary form of an unsigned integer variable value. (Please help me)

#include

void?main()

{

unsigned?int?a,b,n ,mode,i;

scanf("%u",&a);

n=sizeof(unsigned?int)*8;?//

b=a;

mode=1;

for(?i=0;i

mode?<<= ?1?;

printf("mode=%#x\n",?mode?);

printf("%u?in?binary?format?is:" ,a);

while(n>0)?

{

printf("%d",b/mode);

< p> b=b%mode;

mode=mode/2;

n=n-1;

}

}