Why does my C++ output doesn't convert a number into a roman numeral?
-
include <iostream> #include <string> using namespace std; int main() { int number; string numeral; cout<<"Enter a number: "; cin>> number; if(number ==1) numeral = "I"; else if (number ==5) numeral = "V"; else if (number ==10) numeral = "X"; else if (number ==50) numeral = "L"; else if (number ==100) numeral = "C"; else if (number ==500) numeral = "D"; else if (number ==1000) numeral = "M"; return 0; }
-
Answer:
Add the following line to your program before the "return 0" cout << number << " in Roman is " << numeral << endl;
Oliepopz at Yahoo! Answers Visit the source
Other answers
Well, for starters, there's no code for any output.
Related Q & A:
- How to convert a video to a specific format?Best solution by Super User
- Is it true that a permanent resident of the US doesn't need a visa for a short stay in Switzerland?Best solution by Yahoo! Answers
- Why doesn't audio system work on a low volume?Best solution by Yahoo! Answers
- Are there any high paying medical jobs that doesn't require a lot of schooling?Best solution by Yahoo! Answers
- Convert a cassette to a DVD?Best solution by eHow old
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.