A
Ernie polynomial h n ( x ) Recursive implementation.
#include <stdio.h>intHermiteintNint x){if(n<=0) {return 1; }Else if(n==1) {return 2*x; }Else{return 2*x*hermite(n1,x)-2*(N-1)*hermite(n2,x); }return 0;}intMain () {printf("%d\ n", Hermite (3,2));return 0;}
(b) The recursive implementation of the K power of N.
#include <stdio.h>#include <math.h>DoubleCimiDoubleNDoubleK) {if(k==0) {return 1; }Else if(k>0) {returnCimi (n,k-1) *n; }Else{returnCimi (n,k+1)*POW(n,-1); }return 0;}intMain () {printf("%f\n", Cimi (2,-3));return 0;}
(c) Recursive implementation of function Digitsum (n)
– For example Digitsum (1729), corresponding to return 1+7+2+9 and 19.
#include <stdio.h>int DigitSum(n){ intsum0; int tmp = n/10; if0) { sum = DigitSum(tmp)+n%10; } returnsum;}int main (){ printf("%d\n",DigitSum(1729)); return0;}
The IF (n! = 0) ensures that 1729 except 10 to the last obtained 1 can enter the IF sum.
The
"C language" is implemented recursively.