Skip to content

Instantly share code, notes, and snippets.

@David-LeK
David-LeK / romanencoder.txt
Last active May 30, 2021 06:28
Roman Numerals Encoding using function (C++)
#include <stdio.h>
#include <stdlib.h>
int romanencoder(int x)
{
int number[] = {1,4,5,9,10,40,50,90,100,400,500,900,1000};
const char *roman[] = {"I","IV","V","IX","X","XL","L","XC","C","CD","D","CM","M"};
int i=12;
while(x>0)
{