1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
guapka [62]
3 years ago
8

Write a program num2rome.cpp that converts a positive integer into the Roman number system. The Roman number system has digits I

1 V 5 X 10 L 50 C 100 D 500 M 1,000 Numbers are formed according to the following rules: a. Only numbers 1 to 3,999 (inclusive) are represented. b. As in the decimal system, the thousands, hundreds, tens, and ones are express separately. c. The numbers 1 to 9 are expressed as I 1 II 2 III 3 IV 4 V 5 VI 6 VII 7 VIII 8 IX 9 As
Computers and Technology
1 answer:
Tom [10]3 years ago
8 0

Answer:

Explanation:

#include <stdio.h>  

int main(void)  

{    

   int num, rem;

   printf("Enter a number: ");

   scanf("%d", &num);

   printf("Roman numerals: ");        

   while(num != 0)

   {

       if (num >= 1000)       // 1000 - m

       {

          printf("m");

          num -= 1000;

       }

       else if (num >= 900)   // 900 -  cm

       {

          printf("cm");

          num -= 900;

       }        

       else if (num >= 500)   // 500 - d

       {            

          printf("d");

          num -= 500;

       }

       else if (num >= 400)   // 400 -  cd

       {

          printf("cd");

          num -= 400;

       }

       else if (num >= 100)   // 100 - c

       {

          printf("c");

          num -= 100;                        

       }

       else if (num >= 90)    // 90 - xc

       {

          printf("xc");

          num -= 90;                                              

       }

       else if (num >= 50)    // 50 - l

       {

          printf("l");

          num -= 50;                                                                      

       }

       else if (num >= 40)    // 40 - xl

       {

          printf("xl");            

          num -= 40;

       }

       else if (num >= 10)    // 10 - x

       {

          printf("x");

          num -= 10;            

       }

       else if (num >= 9)     // 9 - ix

       {

          printf("ix");

          num -= 9;                          

       }

       else if (num >= 5)     // 5 - v

       {

          printf("v");

          num -= 5;                                      

       }

       else if (num >= 4)     // 4 - iv

       {

          printf("iv");

          num -= 4;                                                            

       }

       else if (num >= 1)     // 1 - i

       {

          printf("i");

          num -= 1;                                                                                    

       }

   }

   return 0;

}

You might be interested in
can i get an access code for free online? if yes, what website is it so i can get a free access code?​
PIT_PIT [208]

Answer:

Codecademy. Codecademy is one of the most popular free coding websites for beginners.  

freeCodeCamp.  

Coursera.  

edX.  

Codewars. ..

Code Conquest. .

GA Dash. .

Khan Academy (highly recommed)

:

6 0
2 years ago
PLz answer I really need the answer
zlopas [31]

Answer:

a

Explanation:

job leads

4 0
3 years ago
Read 2 more answers
Search for and list an internet websites that defines plagiarism and discusses how to avoid it
Korvikt [17]
Here are the sites that defines plagiarism and how to avoid it:
1. http://www.plagiarism.org/article/what-is-plagiarism
2. https://en.wikipedia.org/wiki/Plagiarism
3. https://writingcenter.unc.edu/tips-and-tools/plagiarism/
4. http://gethelp.library.upenn.edu/guides/engineering/ee/plagiarize.html
5. http://www.aresearchguide.com/6plagiar.html
8 0
3 years ago
6. In cell K4, create a formula using the IF function to calculate the interest paid on the mortgage (or the difference between
AVprozaik [17]

Answer:

a. =IF(H4>0,12*$D$5-J4,0)

Explanation:

a. =IF(H4>0,12*$D$5-J4,0)

If( H4>0 is the logical test,

12*$D$5-J4 is [value_if_true]

0 is [value_if_false]

b. Referencing to the above formula in (a), which is the required formula which should be typed in cell K4.

Absolute referencing of cell D5 means that this will not change while extending this formula to the entire column. Whereas, since cell H4 and J4 have relative cell referencing, these will change relatively as we extend the formula to the entire column.

5 0
4 years ago
Four possible skills a person could have
cluponka [151]

Answer:

Active listening skills.

Genuine interest in others.

Flexibility.

Good judgment.

Explanation:

4 0
4 years ago
Other questions:
  • If you delete a view, account administrators can recover the view using the "trash can" function within how many days?
    7·2 answers
  • Write a program that opens a text le called quiz.txt for reading. This le contains a single line with a student's rst name then
    15·1 answer
  • An___ is a rectangular work area in the desk top that contains a program, text, files, it other data and tools.
    5·1 answer
  • How can we compare a computer with human beings?
    14·1 answer
  • Choose the word that matches each definition. : processed facts, how the output is used for making decisions : action performed
    12·2 answers
  • 9.18 LAB: Exact change - methods Write a program with total change amount as an integer input that outputs the change using the
    11·1 answer
  • Create the arrays and assign randomized values for each element in the array. The randomized values should range from 1 to twice
    9·1 answer
  • PLEASE HELP!!<br> giving loads of points<br> create the python codes for the images
    5·1 answer
  • What can relaxation help to reduce?
    14·1 answer
  • What is geospatial technology ??​
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!