I'm a beginner !!I dono why illegal break error happen in this code!!!
Code:
void draw_triangle(){
while (1){
int scounter;
int spacechar=32;
char starchar='*';
int hcounter;
int length;
printf("input height");
scanf("%d",&length);
if(length<=0){
printf(" the length is incorrect \n input the correct height");
continue ; }
int height = length/2 +1;
while (height>0){
for (scounter=height-1 ; scounter>0 ; scounter--){
printf("%c",spacechar);}
for (hcounter=(length-2*(height-1)); hcounter>0; hcounter--){
printf("%c",starchar);
}
printf("\n");
height=height-1;
}
printf("enjoy Ur choice");
printf("select Ur next choice");
}
break;}