title: break statement in c++ by pressing enter
body: <pre><code>#include &lt;iostream&gt;
  using namespace std;
  int main()
  {
      int n,t=0,k=0;
      cin&gt;&gt;n;
      char data[n][100];
      int num[n];
      for(int i=0;i&lt;n;i++)
  {
      while(1)
      {
          cin&gt;&gt;data[i][t];
          cout&lt;&lt;data[i][t]&lt;&lt;endl;
          if(data[i][t]=='\n') break;
          k++;
          if(k%2==1) t++;
      }
      cout&lt;&lt;i;
      num[i]=(t-2)/2;
      k=0;
  t=0;
   }
  
      for(int i=0;i&lt;n;i++)
      {
          while(1)
          {
              cout&lt;&lt;data[i][t];
              if(t==num[i]) break;
              t++;
          }
          t=0;
      }
  }
  </code></pre>
  
  <p>here is the code I have written in c++ which gives the even numbered characters from the starting half of every word given by the user but when giving input after pressing enter the loop should break but the loop is not breaking</p>
  
  <pre><code>while(1)
  {
      cin&gt;&gt;data[i][t];
      cout&lt;&lt;data[i][t]&lt;&lt;endl;
      if(data[i][t]=='\n') break;
      k++;
      if(k%2==1) t++;
  }
  </code></pre>