الخطأ في التكرار الخارجي الwhile
رجاءً شوفوا الخطا وساعدوني....(رجاءً بسرعه)
#include<stdio.h>
#include<conio.h>
main()
{
int control,star,space,next;
char shape,skip;
gotoxy(20,1);
printf("THIS PROGRAM WILL DRAW SOME TRIANGLESn");
printf("do you want to continue(y,n):n");
while(getchar()!='n')
{
printf("select a shape(a,b,c,d):");
shape=getchar();
switch(shape)
{
case'a':case'A':
for(control=1;control<=10;++control)
{
for(star=1;star<=control;++star)
printf("*");
printf("n");
}
break;
case'b':case'B':
for(control=12;control>=1;--control)
{
if(control==10||control==8)
--control;
for(star=1;star<=control;++star)
printf("*");
printf("n");
}
break;
case'c':case'C':
for(control=12;control>=1;--control)
{
if(control==8)
control-=2;
for(space=1;space<=12-control;++space)
printf(" ");
for(star=1;star<=control;++star)
printf("*");
printf("n");
}
break;
case'd':case'D':
for(control=1;control<=10;++control)
{
for(space=1;space<=10-control;++space)
printf(" ");
for(star=1;star<=control;++star)
printf("*");
printf("n");
}
break;
default:
printf("ninvalid shape coden");
}
printf("do u want 2 cont>(y,n):n");
}
}