Question
Write a program that converts a positive integer less than 4000 into the Roman Number system in C++. Only use if statements. When I type
Write a program that converts a positive integer less than 4000 into the Roman Number system in C++. Only use if statements. When I type an integer in the 100s or below it gives me the right roman numbers, but when I type an integer in the 1000s it donsn't have the M.
If I enter 3562 it give me DLXII when it should be MMMDLXII
This is my input, please find what's wrong. Thank You.
#include
int main() { int num; cout << "Enter the whole number less than 4,000 you wish to convert: "; cin >> num; int a,b,c,d; a=b=c=d=0; if(num<4000) { a=num%10; b=num%100-a; c=num%1000-(a+b); d=num%1000-(a+b+c); } if(d>0) { int x; x=d/1000; for(int i=0; i
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started