UMBC CS 201, Fall 06
UMBC CMSC 201
Fall '06

CSEE | 201 | 201 F'06 | 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'06 | lectures | news | help

Last Modified - Tuesday, 22-Aug-2006 07:14:19 EDT