All pastes #1671420 Raw Edit

nicer bitwise things

public c v1 · immutable
#1671420 ·published 2009-11-14 19:46 UTC
rendered paste body
#include <stdio.h>#include <stdlib.h>int main(int argc,char **argv){	int n = atoi(argv[1]);		unsigned int i = 1;	//i = 1<<(sizeof(n) * 8 - 1);	while(i<n)		i *= 2;	printf("potencia: %i\n",i);	printf("binario de %i: ",n);		while (i > 0) {		if (n & i)			printf("1");		else			printf("0");		i >>= 1;	}		printf("\n");		return 0;}//gcc -Wall bitwise.c -o bitwise