Development C

#include
#include
#include
int main(void) {
char *num = "11000110";
int tnum, i, result;
tnum = i = result = 0;
printf("%% %s\n", num);
for(i = 1; *num; num++, i *= 2) {
if(*num == '1')
tnum = 1;
else
tnum = 0;
result += tnum * i;
printf(" %d * %3d = %2d\n", tnum, i, ((tnum * i) ? (tnum * i) : 0));
}
printf(" +--+\n");
printf(" %2d\n", result);
return 0;
}