[go: up one dir, main page]

0% found this document useful (0 votes)
4 views3 pages

Bitwise 4

Uploaded by

Mai Gado
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views3 pages

Bitwise 4

Uploaded by

Mai Gado
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

#include<stdio.

h>

int main()
{
unsigned int ;
int ;
scanf("%u", & );
for( =0; <16; ++)
{
printf("%d", ( << & 1<<15)?1:0);
}
return 0;
}

num

num

num

#include<stdio.h>

int main()
{
unsigned int ;
int =0;
scanf("%u", & );
for(; ; >>=1)
{
if( & 1)
++;
}
printf("%d", );
return 0;
}
num

num

num

#include<stdio.h>
char *fun(unsigned int , int );

int main()
{
char * ;
=fun(128, 2);
=fun(128, 16);
printf("%s\n", );
return 0;
}
char *fun(unsigned int , int )
{
static char [33];
char * = & [sizeof( )-1];
* = '\0';
do
{
*-- = "0123456789abcdef"[ % ];
/= ;
}while( !=0);
return ;
}
#include<stdio.h>

int main()
{
unsigned int [] = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80};
unsigned char , ;
scanf("%d", & );
for( =0; <=7; ++)
{
if( & [ ])
printf("yes");
}
return 0;
}

if

You might also like