getchar function without logical operators (&& ||)
c89 compatibility