Code:/* What's wrong with the damn code?I just gives endless zeros,I want the output to be something like this - 1 1 2 1 1 2 4 2 1 1 2 4 8 4 2 1 Its driving me crazy! */ #include<stdio.h> void main() { int i,j; for(i = 1;i<=8;i*=2) { for(j = 1;j<=i;j*=2) { printf("%d\t",j); if(j == i&&j>1) { for(j = j/2;j>=1;j/=2) { printf("%d\t",j); } } } printf("\n"); } }



LinkBack URL
About LinkBacks





...