#include <stdio.h>
#include <stdlib.h>

/**
 * Exercise 2-2.  
 * Write a loop equivalent to the for loop below without using && or ||.
 *
 * for(i=0; i<lim-1 && (c=getchar()) != '\n' && c != EOF; ++i)
 *    s[i] = c;
 */

int main(void)
{
   int  i     = 0;
   bool valid = 1;

   do
   {
      c = getchar();
      if(c == EOF) 
         valid = FALSE;
      if(c == '\n') 
         valid = FALSE;
      if(valid) 
         s[i++] = c;
   }
   while(valid);

   exit(0);
}
