title: Conditional Statements in Prolog
body: <p>I have just started prolog and was wondering if we can implement conditional statements like(if.else)in Prolog also and if so how??
  Can someone implement this code in Prolog just for an example-</p>
  
  <pre><code>if(a==2)
   print("A is 2");
  if(a==3)
   print("A is 3");
  else
   print("HAhahahahaah");
  </code></pre>
  
  <p>Ok so I am doing this after Sergey Dymchenko answer.</p>
  
  <pre><code>Test(A) :-read(A),
   ( A =:= 2 -&gt;
      write('A is 2')
   ;
      ( A =:= 3 -&gt;
          write('A is 3')
      ;
          write('HAhahahahaah')
      )
   ).
  </code></pre>
  
  <p>This is giving right answer except this is displaying A = 2 also which I dont want(If I give input 2).</p>