title: Program to convert octal to binary number system
body: <p>i am a beginner in c programing language and in this few days i'm train to do some c exercises 
  and i get stucked in some exercice for conversions:
  so this is what i had did </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  #include &lt;string.h&gt;
  
  int main() {
  
      int num[8] = {
          0,
          1,
          2,
          3,
          4,
          5,
          6,
          7
      };
      long long binary, octal, tempoctal;
      int last, i, A, tempi;
      char hex[9] = {
          '000',
          '001',
          '010',
          '011',
          '100',
          '101',
          '110',
          '111'
      };
      int bex[10];
      A = 0;
  
      printf("enter an octal number:  ");
      scanf("%lld", &amp; octal);
  
      tempoctal = octal;
  
      while (tempoctal != 0) {
          last = tempoctal % 10;
  
          for (i = 0; i &lt; 8; i++) {
              if (num[i] == last) {
                  tempi = i;
                  bex[A] = tempi;
  
              }
          }
  
          A++;
          tempoctal /= 10;
      }
  
      printf("\nthe is %s", bex);
  
      return 0;
  }
  
  </code></pre>
  
  <p>so i want just to know why when i want to print the array of bex 
  i get error on the consol <a href="https://i.stack.imgur.com/6laoC.png" rel="nofollow noreferrer">enter image description here</a>.
  Although i know the solution but i want to do it in my own way. </p>