C++ Exercises: Convert a given integer to a roman numeral
Write a C++ program to convert a given integer to a Roman numeral.
From Wikipedia:
Roman numerals are a numeral system that originated in ancient Rome and remained the usual way of writing numbers throughout Europe well into the Late Middle Ages. Numbers in this system are represented by combinations of letters from the Latin alphabet. Modern usage employs seven symbols, each with a fixed integer value:[1]
Sample Input: n = 7
Sample Output: Roman VII
Sample Input: n = 19
Sample Output: Roman XIX
Sample Solution:
C++ Code :
Sample Output:
Integer 7 : Roman VII Integer 19 : Roman XIX Integer 789 : Roman DCCLXXXIX Integer 1099 : Roman MXCIX Integer 23456 : Roman MMMMMMMMMMMMMMMMMMMMMMMCDLVI
Flowchart:

C++ Code Editor:
Contribute your code and comments through Disqus.
Previous: Write a C++ program to multiply two integers without using multiplication, division, bitwise operators, and loops.
Next: Write a C++ program to convert a given roman numeral to a integer.
What is the difficulty level of this exercise?
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics