title: First and Second Call in C
body: <p>I'm trying to generate a random number between 1 and 6, on every second call a random number between one and six is suppose to be generated and on every other call 6 is suppose to be exported to both pointers, I keep getting the output in the opposite behaviour could someone suggest how to rectify this problem.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;time.h&gt;
  
  void loadedDice(int*, int*);
  
  int main(void)
  {
      int a = 0, b = 0;
      srand(time(NULL));
      loadedDice(&amp;a, &amp;b);
      printf("%d %d\n", a, b);
      loadedDice(&amp;a, &amp;b);
      printf("%d %d\n", a, b);
      loadedDice(&amp;a, &amp;b);
      printf("%d %d\n", a, b);
  
      return 0;
  
  }
  
  
  void loadedDice(int* export1, int* export2)
  {
      if(*export1 == 6 &amp;&amp; *export2 == 6)
      {
      *export1 = 1 + (rand()%6);
      *export2 = 1 + (rand()%6);
  
      } else {
      *export1 = 6;
      *export2 = 6;
      }
  }
  </code></pre>