Production Implementation
1. Complete C Code: intToRoman()
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char* intToRoman(int num) {
static const int values[] = {
1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1
};
static const char* symbols[] = {
"M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I"
};
char* result = (char*)malloc(16 * sizeof(char));
if (!result) return NULL;
result[0] = '