haha thnx to u guys i got this thing to work but there is a one problem
i dont know how to change 4 to IV
when i type 4 it comes out like IIII
4,9,40,90 ....
Code:
while (x != 0)
if (x >= 1000)
{
x = x - 1000;
cout << "M";
}
else if (x >= 500)
{
x = x - 500;
cout << "D";
{
else if (x >= 100)
{
x = x - 100;
cout << "C";
{
else if (x > 50)
{
x = x-50;
cout << "L";
}
else if (x >= 10)
{
x = x - 10;
cout << "X";
}
else if (x >= 5)
{
x = x - 5;
cout << "V";
}
else if (x >= 1)
{
x = x - 1;
cout << "I";
}
}