#includeint main(){ int arr[8] = {1, 2, 3}; int i, j, k =1; for(i=0 ; i<8; i++) { printf("{ "); j = i; k = 1; while(j != 0) { if(j & 1) printf("%d ", k); j = j >> 1; k = k + 1; } printf("}\n"); } return 0;}
#include
ReplyDeleteint main()
{
int arr[8] = {1, 2, 3};
int i, j, k =1;
for(i=0 ; i<8; i++)
{
printf("{ ");
j = i;
k = 1;
while(j != 0)
{
if(j & 1)
printf("%d ", k);
j = j >> 1;
k = k + 1;
}
printf("}\n");
}
return 0;
}