rendered paste body#include <malloc.h>#include <math.h>#include <stdlib.h>#include <stdio.h>struct lijst{double getal;struct lijst* volgend;};void split(struct lijst *hoofd, int** n, float** frac);int telAantal(struct lijst *hoofd);double geefGetal(struct lijst* hoofd, int i);void printUit(struct lijst *hoofd);void voegToeS(struct lijst **hoofd,float j);int main(void){int i;int *n = NULL;float *frac = NULL;struct lijst *lijst1 = NULL;voegToeS(&lijst1,5.8);voegToeS(&lijst1,8.4);voegToeS(&lijst1,9.23);voegToeS(&lijst1,1.52);voegToeS(&lijst1,0.4);printUit(lijst1);split(lijst1,&n,&frac);for(i=0; i<5;i++) printf("\n%d \t %.3lf",n[i],frac[i]);while(1);return 0;}void split(struct lijst *hoofd,int **n, float **frac){ int i,aantal = telAantal(hoofd); double *ptr; int *tabel = *n; float *ftabel = *frac; ftabel = (float*) malloc(sizeof(float *) * aantal); tabel = (int*) malloc(sizeof(int *) * aantal); for(i=0; i < aantal; i++){ ptr = (double *)malloc(sizeof(double)); ftabel[i] = (float)modf(hoofd->getal,ptr); tabel[i] = (int)(*ptr); printf("\nTEST: %d , %.1f",tabel[i],ftabel[i]); hoofd = hoofd->volgend; } *n = tabel; *frac = ftabel; printf("\nend test\n\n");}int telAantal(struct lijst *hoofd){int i = 0;while(hoofd != NULL){ hoofd = hoofd->volgend; i++; }return i;}void voegToeS(struct lijst **hoofd,float j){ struct lijst *hulp = *hoofd; struct lijst *nieuw = (struct lijst *) malloc ( sizeof(struct lijst*)); nieuw->getal = j; nieuw->volgend = NULL; if(hulp == NULL) *hoofd = nieuw; else { while(hulp->volgend != NULL) hulp = hulp->volgend; hulp->volgend = nieuw; }}void printUit(struct lijst *hoofd){ while(hoofd != NULL) { printf("\n%.3lf\t\t%p",hoofd->getal,hoofd->volgend); hoofd = hoofd->volgend; }}