title: String Compare With Write Statement
body: <pre><code>checkChar :-
      nl,
      write('Enter a character [press 0 to stop]: '),
      get(X),
      process(X).
  
  process(X) :-
      S = put(X),
      0 == S,
      !.
  
  process(X) :-
      write('ASCII code for &lt;'),
      put(X),
      write('&gt;:'),
      write(X),
      checkChar.
  </code></pre>
  
  <p>User will input anything they want, the prolog will translate the character into the ASCII code and display it.
  The prolog will stop to execute if inputted 0, but how can i do that other than straight away compare with ASCII 48? (ASCII 48 = 0)
  This is what i had tried, but it still can't stop once i enter 0.</p>