title: Javascript find max number from 3 inputs
body: <p>I've just began Javascript in college. One task is to define and call a function to find the maximum number from 3 numbers entered by the user. I know there is a max() function but we were told to do it manually using if and else if.</p>
  
  <p>I'm going wrong somewhere as you can see. It's just telling me the max is 0 everytime.</p>
  
  <pre><code>function maxNum(num1, num2, num3){
          var max = 0;
          if(num1 &gt; num2){
              if(num1 &gt; num3){
                  num1 = max;
              }
              else{
                  num3 = max;
              }
          }
          else{
              if(num2 &gt; num3){
                  num2 = max;
              }
          }
      return max;
      }
  
      for(i=0;i&lt;3;i++){
          parseInt(prompt("Enter a number"));
      }
      document.write(maxNum());
  </code></pre>