UMBC CS 201, Fall 05
UMBC CMSC 201 Fall '05
CSEE | 201 | 201 F'05 | lectures | news | help

Multiply

Multiply works by adding a to itself b times

int Multiply( int a, int b) 
{
   /* Base Case */
   if (b == 1) 
   {
      return(a);
   }

   /* General Rule - recursive case */
   return (a + Multiply (a, b - 1)));
}




CSEE | 201 | 201 F'05 | lectures | news | help

Last Modified - Saturday, 05-Nov-2005 11:10:19 EST