title: rand() keeps giving me the same number and decreasing 4 by variable
body: <p>I was trying to do this work for a class i have but for some reason i can't get the <code>rand()</code> to work, i've tested several diferent things to try and get it to work, but i just can't figure it out. I'm new to C so i might be doing something wrong here please help.</p>
  
  <pre><code>#include &lt;stdlib.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;time.h&gt;
  
  int main() {
      srand( time(NULL) );
      int num, rep, nu, ba, bas;
      char B[20] = "";
      char C[20] = "";
  
  
      printf("Jogo: Converter Bases!\n");
      printf("\n Quantas perguntas desejas responder? (1-6)");
      scanf("%d", &amp;num);
      while (num &lt;= 0 || num &gt; 6) {
          printf("\n Introduz um  valor valido de 1 a 6: ");
          scanf("%d", &amp;num);
      }
      for (int p=0; p&lt;num; p++) {
          nu=rand()% 10;
          bas=rand()% 3;
          ba=rand()% 3;
  
          printf("\nnu = %i bas = %i ba = %i", &amp;nu, &amp;bas, &amp;ba);
  
          while (ba = bas) {
              ba = rand()% 3;
          }
          if (bas = 0) {
              char B[20] = "Octal";
          } else if (bas =1) {
              char B[20] = "Decimal";
          } else {
              char B[20] = "Hexadecimal";
          }
          if (ba = 0) {
              char C[20] = "Octal";
          } else if (ba =1) {
              char C[20] = "Decimal";
          } else {
              char C[20] = "Hexadecimal";
          }
          printf("Converte %i de base %c para base %c\n", &amp;nu, &amp;B, &amp;C);
          scanf("%d", &amp;rep);
      }
      return 0;
  }
  </code></pre>
  
  <p>`</p>