I came across this code for the binary representation of a number. I want to know the need for using !! in the code.
int main() {
int n,i;
unsigned flag = 1<<(sizeof(int) * 8 - 1);
printf("Input the number\n");
scanf("%d",&n);
for(i=0;i<sizeof(int)*8;i++) {
printf("%d",!!(n & flag) );
n = n << 1;
}
return 0;
}