C
c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
char** split(double d){
//buf to store string version of d
char buf[50];
//n is length of buf
int n_len = sprintf(buf, "%.10lf", d);
//ch to extract integer part
char* ch = strtok(buf,".");
//dot_idx tlis length of integer part
int int_len = strlen(ch);
//memory allocations
char** result = malloc(
(n_len/int_len)*sizeof(char*));
result[0] = malloc(int_len*sizeof(char*));
result[1] =
malloc((n_len-int_len)*sizeof(char*));
//value assignment
strcpy(result[0], ch);
//ch to extract fractional part
ch = strtok(NULL, " ");
//value assignment
strcpy(result[1], ch);
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run