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
How dose society use computer in government?​
SCORPION-xisa [38]

Answer:

Like businesses, state and federal government offices use computers. Government employees must set up meetings and distribute various reports. ... Computer uses in government offices also include various e-mail functions, payment distribution, record keeping and even coordinating mailings.

Explanation:

8 0
2 years ago
In 1-2 pages, identify a social networking technology and identify at least 10 security and/or privacy risks the technology has
algol13

Answer:

One of the biggest social media giants has faced many such security and privacy risks in the past 3 years. 10 are listed below:

1. No one can forget the New Zealand attack on the mosque, and it was telecast live via it. And that is certainly a security risk. And if someone is able to stream live, the AI is in question definitely as this cannot be telecast.

2. Can you forget the various US shooting cases in the past 5 years? And many out of them where telecast lives on it. Again the AI, and the authentication is in question.

3. Many evils have many times advertised itself through it, and that is a security risk. This put up the question on the Data Scientists of the company.

4. It's a huge data on it, and many users have been able to misuse it, and that is a security risk. This put up the question mark on the application of the Big Data.

5. Once, the UK parliament questioned it to sell the secret data, and that was a privacy risk.

6. An Engineer was caught negotiating to sell secret users data to a third party, and that is a privacy risk as well as a question on management technology, as its possible now to check these kind of frauds.

7. Its accounts have been hacked many times, as well as millions of user-profiles, were stolen. This is a security and privacy risk.

8. Its data is still not safe as evils have proved they can break the authentication. However, it has reacted well, and they look like being a safe destination now.

9. Once, someone from Russia was caught collecting a lot of data from it. That was a security and privacy risk. And surely if someone is uploading a lot of complicated and confidential data, must be checked through proper AI implementation.

10. In India too there have been claims that a lot of personal information during elections 2014 was sold. That was a security and data risk. And the data scientists were proved vulnerable again. Its quite sure hence, a lot of work has to be done in Data Science and Artificial intelligence still.

However, its owner is one of the finest souls on earth. He donated all his money when he was blessed with a child. Some out of his team cheated, and else some technology failure or the huge amount of data was the reason for the fault. However, other companies are also facing such problems. And hence, he cannot be blamed for this. And the company now definitely has recovered from the nightmare that they faced in the past 3 years.

Explanation:

The answer is self explanatory.

8 0
3 years ago
What are the two basic steps in communication
Andrei [34K]

The sender forms an idea.The sender encodes the idea in a message.

4 0
3 years ago
One of the most studied computational problems is the ordering of a collection of values. Ordering is important because many pro
andreyandreev [35.5K]

I think the order should be 2-1-3-4, but the description of step 1 is confusing. In selection sort, you iterate from the point of the marker down through the entire list and find the smallest value, and swap that with the value at the marker. Then you advance the marker and repeat the process on the remainder of the list.

7 0
3 years ago
Guys im getting the ps5 tomorrow :)​
Paha777 [63]

Answer:

lucky mf

Explanation:

5 0
2 years ago
Read 2 more answers
Other questions:
  • The spreadsheet below shows the names years in office, and number of terms for five US presidents
    7·2 answers
  • ______ means locating a file among a set of file​
    14·1 answer
  • Because log-on procedures may be cumbersome and tedious, users often store log-on sequences in their personal computers and invo
    6·1 answer
  • What natural boundary separated british territory from louisiana?
    7·1 answer
  • A network using multiple cell towers falls under which type of network?
    13·1 answer
  • Fatal error: Class 'Drush\Commands\DrushCommands' not found in /Users/amy/testsite/Sites/acquia dev desktop/fresh-install/module
    7·1 answer
  • Some numbers are formed with closed paths. the digits 0, 4, 6 and 9 each have 1 closed path and 8 has 2. None of the other numbe
    6·1 answer
  • Doctors at a regional hospital access an online database of patient records that is being developed and tested by a conglomerate
    13·1 answer
  • It is important to know the terms of use of any website because why
    12·2 answers
  • 2. Which of the following is a shortcut key to Exit from any operation?
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!