Last modified on 30 November 2010, at 14:37

Algorithms/Find maximum/jscript 6

  function findMaxFourEle(i_intA,i_intB,i_intC,i_intD) {
     var o_intMax = i_intA;
     if ( i_intB > o_intMax )
        o_intMax = i_intB;
     if ( i_intC > o_intMax )
        o_intMax = i_intC;
     if ( i_intD > o_intMax )
        o_intMax = i_intD;     
     return o_intMax;
  } // end method
  function findMaxThreeEle(i_intA,i_intB,i_intC) {
     return findMaxFourEle(i_intA,i_intB,i_intC,i_intC);    
  } // end method     
  document.write(findMaxThreeEle(3,4,5));