I want to be able to print a diamond like this when the user enters 5 for the diamond. But also will work for any value that is odd and greater than 0.
Hi i got to best solution for this problem in less no of lines
int b=0; for(int a=0;b<=50;a=(b<=25) ? a+2 : a-2 ){ b+=2; for(int b=25-a;b>0;b-=2){ printf(" "); } for(int c=0;c<=a;c++){ printf("*"); } printf("\n"); }