/*------------------------------------------------------------------------------*
 * File Name: factorial2.cpp														*
 * Creation: 																	*
 * Purpose: Calculates factorials of the form n*(n-m)*(n-2m)...					*
 *																				*
 *																				*
 * Modification Log:															*
 *------------------------------------------------------------------------------*/
 
////////////////////////////////////////////////////////////////////////////////////

#include <Origin.h>
// This statement makes available all C libraries and all Origin Libraries

#include "Mylibrary.h"
// This statement makes avaialble to the user all of the user-defined fucntions
// listed in the file MyLibrary.h

////////////////////////////////////////////////////////////////////////////////////


double factorial2 (int n, int m) 

{  

    double  factorial2 = n;

    int  j;
		
    for (j = n - m; j>= 1; j = j - m)
    	factorial2=factorial2*j;

       return factorial2;

}
