where is the problem in this code???,,,,,
#include<stdio.h>
#define EOS '\0'
int islet(char c)
{
if(c>='a'&& c<='c')return(1);
else
return(0);
}
int main()
{
char c,inpstr[]="abbbbccccb";
int q,i,j;
int count=0;
printf("%s",inpstr);
q=1;
i=0;
c=inpstr[i];
while(c!=EOS)
{
if(q==1 && (inpstr[0]=='a')){q=2;}
else if(q==2 && (inpstr[i>=1 ||i<=19]=='b')&& islet(c) )
{q=2;}
else if(q==2 &&(inpstr[i]=='c') && islet(c)){
count++;
if(count>1){printf("%d",count);}
else
{q=3;}
}
else if(q==3 && (inpstr[0]=='b')){q=4;}
else{
q=5;
break;
}
c=inpstr[i++];
}
if(q==5){
printf("illegal");}
else{
printf("legal");
}
return(0);
}