title: How to get the number of variable b one less than a?
body: <p>My numbers go in order from 0 to 3
  But I need the variable b to be less by 1 and not go beyond.</p>
  
  <p>Initially, the number is unknown, after receiving the number it is stored in only one variable, the number cannot be changed, but you need to get another number one less for the other variable.</p>
  
  <p>I need to implement it like this.</p>
  
  <pre><code>1 A
  0 B
  
  2 A
  1 B
  
  3 A
  2 B
  
  0 A
  3 B
  
  1 A
  0 B
  </code></pre>
  
  <p>What I have now</p>
  
  <pre><code>int i = 0, a = 0, b = 0;
  
  for (;;)
  {
      this_thread::sleep_for(chrono::milliseconds(500));
  
  
      i = (i + 1) % 4;
  
      a = i;
  
      b = i;
  
      cout &lt;&lt; a &lt;&lt; " A " &lt;&lt; endl;
  
      cout &lt;&lt; b &lt;&lt; " B " &lt;&lt; endl;
  
      cout &lt;&lt; endl;
  
  }
  </code></pre>