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]
2 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]2 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
when using screwdrivers you should always be aware that the screwdriver blade might slip out of the slot and strike you in the .
ELEN [110]

When using screwdrivers you should always be aware that the screwdriver blade might slip out of the slot and strike you in the:

  • -hand
  • -eye
  • -mouth

<h3>What is a Screwdriver?</h3>

A screwdriver is said to be a kind of a modern tool that can come in a manual or powered type and it is one that is often used for turning screws.

Note that a typical simple screwdriver is one that has a handle as well as a shaft and it is also one that is often ending in a tip where a given user can be able to put their hands into the screw head before turning the handle.

Therefore, when using screwdrivers you should always be aware that the screwdriver blade might slip out of the slot and strike you in the:

  • -hand
  • -eye
  • -mouth

Learn more about screwdrivers  from

brainly.com/question/20717091

#SPJ4

3 0
1 year ago
When formulating a linear programming model on a spreadsheet, the decisions to be made are located in the data cells.
Alinara [238K]
True. Gotta have 20 characters to answer
8 0
1 year ago
A program that helps computer users do specific things like word processing, etc., e-mailing, or browsing the Internet
Dimas [21]

This is an application

6 0
3 years ago
A security technician is configuring a new firewall appliance for a production environment. The firewall must support secure web
Zielflug [23.3K]

Answer:

Explanation:

Based on the information provided in the question, the best rules that the technician should add to the firewall would be the following

Permit 10.10.10.0/24 0.0.0.0 -p tcp --dport 443

Permit 10.10.10.0/24 192.168.1.15/24 -p udp --dport 53

This is because port 443 is used for "Secure webs services" while UDP port 53 is used for queries and domain name resolution. Both of which are the main configurations that the security technician needs to obtain.

8 0
3 years ago
You need to give mary only the rights that she needs. This must be accomplished with the least amount of administrative effort
Arte-miy333 [17]

Answer:

Management is not that easy. And at each level of the work environment, we need it. Suppose Mary works under an editor, and as a writer. Then She will be provided by editor a certain set of rights, that she requires to accomplish her work. And the chief editor who heads the editor, and who might be the administrator has nothing to do with this. And thus this will ensure that the chief editor or the administrator can accomplish other works during this time. And this will certainly save time, of the whole team. And its a rule in management, that only those rights are provided, that are required by the worker, and like in case of Mary.

Explanation:

Please check the answer section.

7 0
3 years ago
Other questions:
  • Newt Corporation, headquartered in Los Angeles, is a nationwide provider of educational services to post-graduate students. Due
    9·1 answer
  • What is the correct order of network types when categorized by their size or the physical area they cover, from largest to small
    10·1 answer
  • If you enter 234.567 into a cell that is formatted to display 1 decimal point place, what is the value stored in the cell
    9·1 answer
  • // This pseudocode is intended to display // employee net pay values. All employees have a standard // $45 deduction from their
    12·1 answer
  • Which building-block feature is available in the Text grouping on the Insert tab?
    14·1 answer
  • Which statement is true about customizing presentation programs?
    9·1 answer
  • Which of the following is false about ERP II systems? Question 18 options: 1) They utilize the Web. 2) They include human resour
    9·1 answer
  • Which of the following is NOT areserved word in Java?intpublicstaticnum
    9·1 answer
  • Write a program that reads in a text file, infile.txt, and prints out all the lines in the file to the screen until it encounter
    15·1 answer
  • Write the application of computer in education and communication​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!