public string IntToRoman(int num) {
while(num >= 10)
{
for(int i = num ; num >= 10 ; i= i/10)
{
if(i<= num)
{
var Name = Enum.GetName(typeof(RomanToInt), i*10);
a= a+""+Name;
}
num= num % j - num % (j / 10);
i = num;
}
}
if(num < 10)
{
for(int i = 0 ; i <= num ; i++)
{
if(num < 5)
{
var Name = Enum.GetName(typeof(RomanToInt), 1);
b = b+""+Name;
}
else
{
var Name = Enum.GetName(typeof(RomanToInt), 5);
b = b+""+Name;
num= num - 5;
}
}
}
s=a+""+b;
return s;
}
Asked
Active
Viewed 62 times
0

Retired Ninja
- 4,785
- 3
- 25
- 35

MOUNIKA
- 1
-
What's your definition of `RomanToInt`? Please see [ask] – NineBerry Mar 26 '22 at 08:47
-
Does this answer your question? [Converting integers to roman numerals](https://stackoverflow.com/questions/7040289/converting-integers-to-roman-numerals) – Bagus Tesa Mar 26 '22 at 08:51