title: C function to convert from decimal to octal
body: <p>I am working on a homework problem that asks us to write a function in C that will convert from decimal to octal. Here's what I have so far</p>
  
  <pre><code>int oct(int num) {
      if (num &lt; 8) {
          return num;
      }
      else {
  
      }
  }
  </code></pre>
  
  <p>So yeah I'm pretty stuck, any help is very much appreciated
  Thanks</p>