I want to arrange the number 1 - 12 like shown below. like the numbers on the clock.
12
11 1
10 2
9 3
8 4
7 5
6
arrived with the following code:
#include<stdio.h>
int main(){
int e = 11;
int count = 10;
int col = 10, sp3 = 4;
printf(" 12\n");
for(int i = e; i > 8; i--){
for(int sp = col; sp >=0; sp--){
printf(" ", sp);
}
printf("%d", i);
for(int sp2 = 0; sp2 <= sp3; sp2++){
printf(" ");
}
col--;
sp3++; sp3++;
printf("%d\n",i-count);
count--; count--;
}
for(int i = 8; i >= 7; i--){
for(int sp = -2; sp <=col; sp++){
printf(" ", sp);
}
printf("%d", i);
for(int sp2 = sp3; sp2 >= 4; sp2--){
printf(" ");
}
col++;
sp3--; sp3--;
printf("%d\n",i-count);
count--; count--;
}
printf(" 6\n");
return 0;
}
out put i got is like this : [IMG]http://a.imagehost.org/t/0821/Screenshot-2.jpg[/IMG]
this code is good/bad/ugly. comments please.