how to implement a circular counter?
<p>I want to make a circular counter in C programming.
   First variable can store value from 0-3.
   Second variable asks the value from user (from 0-3).
   Third variable asks user to move either left or right</p>

<p>If third variable is left 
    the second variable should move left:</p>

<pre><code>3-&gt;2
2-&gt;1
1-&gt;0
0-&gt;3
</code></pre>

<p>Similarly if third variable is right
    the second variable should move right:</p>

<pre><code>0-&gt;1
1-&gt;2
2-&gt;3
3-&gt;0
</code></pre>