Ups, I've written the input wrong. Sorry for that.
Assuming the input 7 is right.
WingedPanther thank you very much for your explanation. I'll start to writting after this post. It'll work. Thank you very very much.
Code:
#include <stdio.h>
main()
{
int h, led, inner, star;
printf("please enter the height of diamond> ");
scanf("%d", &h);
for ( led = (h-1)/2 ; led<=0 ; led-- )
printf(" ");
for ( star = 1 ; star<=2 ; star++ )
printf("*");
for ( inner = 0 ; inner<=h-2 ; inner++ )
printf(" ");
for ( led = (h-1)/2 ; led <=0 ; led--) {
printf(" ");
printf("\n"); }
system("pause");
return 0;
}
I couldn't understand what's wrong with this code? I think I did everything true?