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
Which access database object is best to use for the basis of a report when specific criteria must be applied to the report?
Anna007 [38]
The answer is Query.

A query helps a user retrieve specific items from a MS Access database. If you have an item that matches with all the criteria you enter, it shows in the query results. A query is sent to the data source to retrieve the data.




8 0
3 years ago
Read 2 more answers
Templates allow for the quick creation of _____.
Ivan
Templates allow for the quick creation of a website
5 0
3 years ago
What is the key value proposition of Google Search campaigns?A. Appear as a text ad, a video ad, or a banner ad on one of Google
crimeas [40]

Answer:

The correct option is D: Show your ads when a customer is searching for your product or service

Explanation:

Google Search Campaigns allows for advertisement display when you run a search on Google Search. It then displays the result of the search in the search results. The key value proposition of Google Search Campaigns is "Show your ads when a customer is searching for your product or service". Google Search Campaigns are known to be a very popular online advertising form.

5 0
3 years ago
People read all caps in e-mails as _____. yelling important points necessary for readability all of the above
mezya [45]
Yelling is the correct answer
6 0
3 years ago
Read 2 more answers
Select the correct answer.
Svetradugi [14.3K]

Answer:

C. Universal

Explanation:

7 0
3 years ago
Other questions:
  • 11What is the definition of bandwidth? the speed at which bits travel on the network the measure of the transfer of bits across
    7·1 answer
  • A computer company has $3840000 in research and development costs. Before accounting for these costs, the net income of the comp
    5·1 answer
  • You will be given a value of n and k, one line each. You will write a program that determines the minimum number of probe attemp
    9·1 answer
  • What is the purpose of a transistor?
    13·2 answers
  • Explain what is meant by information technology (IT). Explain what is meant by information systems (IS). Why is it important to
    7·1 answer
  • The U.S. National Institute of Standards and Technology defines the incident response life cycle as having four main processes:
    13·1 answer
  • 4) Which is a more efficient way to determine the optimal number of multiplications in a matrix-chain multiplication problem: en
    15·1 answer
  • Trebuie sa scrii niște instrucțiuni în JavaScript care adaugă în DIV lungimea HTML-ului din interiorul tag-ului cu ID​
    14·1 answer
  • 4. Arnold curates articles that feature trending lists for an online website. His department is responsible
    5·1 answer
  • Explain why you would use the soft on/off jumper when working on ATX system
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!