http://i37.tinypic.com/118f1iu.jpg **Question and output sample is in the link**
ID: 3614629 • Letter: H
Question
http://i37.tinypic.com/118f1iu.jpg**Question and output sample is in the link***
I'm stuck and this is all I have so far...=[
[code]
int main() {
int a,b,c,i,j,k,n;
printf("Enter an odd number in the range 1 to 19for the number of rows of the diamond: ");
scanf("%d",&n);
//for the first half of diamond
for(i=n;i>0;i--) {
for(j=1;j<i;j++) {
printf(""); }
for(k=j-1;k<n;k++) {
printf("*");
printf(" ");
}
printf(" ");
}
//for the second half of diamond
for(a=n-1;a<n && a!=-1;a--) {
for(b=n;b>a;b--) {
printf(""); }
for(c=0;c<a;c++) {
printf("*");
printf(" ");
}
printf(" "); }
return 0;
}
[/code]