/*Translated by FOR_C, v3.4.2 (-), on 07/09/115 at 08:33:09 */
/*FOR_C Options SET: ftn=u io=c no=p op=aimnv pf=,p_dcpval s=dbov str=l x=f - prototypes */
#include <math.h>
#include "fcrt.h"
#include <stdio.h>
#include <stdlib.h>
#include "p_dcpval.h"
/*     DEMONSTRATE DCPDRV, DCPINT, AND DCPVAL.
 *>> 2001-05-22 DRDCPVAL Krogh Minor change for making .f90 version.
 *>> 1997-05-29 DRDCPVAL Krogh Special code for C conversion.
 *>> 1996-05-28 DRDCPVAL Krogh Added external statement.
 *>> 1994-10-19 DRDCPVAL Krogh  Changes to use M77CON
 *>> 1987-12-09 DRDCPVAL Lawson  Initial Code.
 *--D replaces "?": DR?CPVAL, ?CPDRV, ?CPINT, ?CPVAL
 * */
 
int main( )
{
	long int nq, nr;
	double q[7], r[6], z;
	static double p[6]={5.e0,2.e0,10.e0,8.e0,6.e0,4.e0};
		/* OFFSET Vectors w/subscript range: 1 to dimension */
	double *const P = &p[0] - 1;
	double *const Q = &q[0] - 1;
	double *const R = &r[0] - 1;
		/* end of OFFSET VECTORS */
 
	/*++ Code for .C. is active */
   long int i;
	/*++ End */
 
	dcpint( p, 3, q, &nq );
	dcpdrv( q, nq, r, &nr );
	z = dcpval( q, nq, 6.e0 ) - dcpval( q, nq, 4.e0 );
	/*++ Code for ~.C. is inactive
	 *      write(*,1000) P,Q,R,Z
	 * 1000 format(21X,'P =',2F4.0,2X,4F7.2//' INTEGRAL OF P.      Q ='
	 *     *,2F4.0,2X,5F7.2//' DERIVATIVE OF Q.    R =',2F4.0,2X,4F7.2/
	 *     *>' DEFINITE INTEGRAL.  Z =',F20.8)
	 *++ Code for .C. is active */
   printf("                     P =%4.0f%4.0f  ", p[0], p[1]);
   for(i=2L; i < sizeof(p)/sizeof(p[1]); i++)
           printf("%7.2f", p[i]);
   printf("\n INTEGRAL OF P.      Q =%4.0f%4.0f  ", q[0], q[1]);
   for(i=2L; i < sizeof(q)/sizeof(q[1]); i++)
           printf("%7.2f", q[i]);
   printf("\n DERIVATIVE OF Q.    R =%4.0f%4.0f  ", r[0], r[1]);
   for(i=2L; i < sizeof(r)/sizeof(r[1]); i++)
           printf("%7.2f", r[i]);
   printf("\n DEFINITE INTEGRAL.  Z =%7.2f\n", z);
	exit(0);
	/*++ End */
} /* end of function */