i am a starter and i have written a code:

```
#include<stdio.h>
char c;
char a[100]={0};
int i;

int main(void)
{   
  while(1)
  {
    i=0;
    while(1){
      if((c=getchar())!='\n'){
        a[i]=c;
        i++;
      } else {
        break;
      }
    }
    printf("%s\n",a); 
  }
  return 0;
}

```

and now i have idea that i want to add a break statement that when i type q, the program will break. so my new program is:

```
#include<stdio.h>
char c;
char a[100]={0};
int i;

int main(void)
{   
  while(1)
  {
    i=0;
    while(1){
      if((c=getchar())!='\n'){
        a[i]=c;
        i++;
      } else {
        break;
      }
    }
    printf("%s\n",a);
    if(getchar()=='q')break;       /*i added this*/
  }
  return 0;
}

```

i know because the getchar() conflict the code is not correct, how can i do, to add the type q break command. thanks a lot.