Add 3 Numbers


 
   ///////////////////////////////
   // wyatt
   //    accepts 3 ints
   //    sums
   //    returns answer
   //////////////////////////////
   
   private static int Sum3 ( int num1, int num2, int num3 )
   {
      int sum;
      
      // calculate & return answer
      sum = num1 + num2 + num3;
      return sum;
   }
   
OR
  

   private static int Sum3 ( int num1, int num2, int num3 )
   {
      // calculate & return answer
      return ( num1 + num2 + num3 );
   }                        

 

TO CALL:
  

   To Call:            
     int x = 2, y = 3;
     int answer = Sum3(x, y, 5); // returns 10 in the variable, answer