UMBC CS 201, Spring 06
UMBC CMSC 201
Spring '06

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

Last Modified - Monday, 23-Jan-2006 09:13:40 EST