- #1
mulabisc
- 3
- 0
I have tried to come up with the code below so i want to improve it so tha it converts numbers 1 to 1000 to romans.. help out!
#include <iostream>
using namespace std;
int main()
{
int n;
n >=1;
cout<< "please enter an interger number:" <<endl;
cin >> n;
if(n == 9)
cout << "IX";
else if(n >=5 && n<=8)
cout << "V";
else if (n == 4)
cout << "IV";
else if(n >=1 && n <=3)
cout << "I";
return 0;
}
#include <iostream>
using namespace std;
int main()
{
int n;
n >=1;
cout<< "please enter an interger number:" <<endl;
cin >> n;
if(n == 9)
cout << "IX";
else if(n >=5 && n<=8)
cout << "V";
else if (n == 4)
cout << "IV";
else if(n >=1 && n <=3)
cout << "I";
return 0;
}