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
Nataly_w [17]
2 years ago
14

Write a simple program that takes in a numerator and denominator and then computes the GCD for that fraction. You can assume tha

t there is a GCD for any fraction entered. Once you have found the GCD, print the original fraction and the fraction reduced with the GCD to the command line. To get full credit for this assignment, you must use iteration. java
Computers and Technology
1 answer:
Marizza181 [45]2 years ago
3 0

A simple program that takes in a numerator and denominator and then computes the GCD for that fraction is Enter your and then Enter your denominator: zero Invalid input, denominator can't be zero.

<h3>What is numerator and denominator in programming?</h3>
  1. Enter your denominator: zero Invalid input, denominator can't be zero.
  2. Enter your denominator: 3
  3. The lowest phrases of your fraction: 34/3
  4. Enter your denominator: 6.
  5. The lowest phrases of your fraction: 1/2
  6. ++ Code

  1. # include
  2. # include
  3. the use of namespace std;
  4. // Function to calculate GCD
  5. int g_c_d(int num1, int num2)
  6. go back num2;
  7.   if (num2 == 0)
  8. go back num1 if (num1 == num2)
  9. go back num1;
  10. // Function to lessen to fraction to lowest phrases
  11. bool to_lowest_terms(int &numerator, int &denominator)
  12. {
  13. if (denominator == 0)
  14.   if (numerator == 0)
  15.  cout << "nThe lowest phrases of your fraction: " << 0 xss=removed> 0 && denominator > 0);
  16. numerator = abs(numerator);
  17. denominator = abs(denominator);
  18. int factor = g_c_d(numerator, denominator)

Read more about GCD :

brainly.com/question/219464

#SPJ1

You might be interested in
Which of these is a formatting option that you can use to enhance your text document?
Paha777 [63]
My best guess is the last option (D) tools. Hope it helps
8 0
3 years ago
Read 2 more answers
Which of the following should NOT be done to keep people from slipping on floors?
irina [24]

you should not leave them to air dry

5 0
3 years ago
Which osi/iso layer is responsible for determining the best route for data to be transferred?
RSB [31]
TCP/IP, (I believe) layer 3 is the only layer with a concept of networks and routing.
3 0
3 years ago
A DDos attack _____________.
melomori [17]

Answer:

Option (1) the is correct answer for the above question.

Explanation:

"DDos" stands for distributed denial-of-service. It is a type of attack which affects the network route. It disturbs the normal route like a traffic Jam. It operators from some hosts point and act after getting access to the system in an unauthorized way.

It attacks to disturb the service provided by the other system. It authorized the hosts' system and entered into the system to get disturb the routine of the system.

  • Option 1 also suggests the same hence it is a correct option.
  • While option 2 suggests that it is a software, but it is a concept that means to disturb the normal routine of the system and he can get that information access which is transmitted over the signals. hence option 2 is not fit for the question.

4 0
3 years ago
Which networking devices forward incoming data between computer networks
Gnoma [55]

Answer: C,D

Explanation:

Wireless routers are commonly found in homes -- they're the hardware devices that Internet service providers use to connect you to their cable or xDSL Internet network. A wireless router, also called a Wi-Fi router, combines the networking functions of a wireless access point and a router.

6 0
3 years ago
Read 2 more answers
Other questions:
  • The user interface design principle that places an emphasis on the intuitive flow of the interface (i.e. left to right and top t
    12·1 answer
  • What's the first step in being a wise consumer of media?
    10·2 answers
  • 14. Which now-established technology went through the “emerging” phase in the early 2000s and makes the sharing of ideas much ea
    7·1 answer
  • What is the term for a set of actions carried out on inputs?
    7·1 answer
  • Because mobile users consume information one screen at a time, you should ________ when you're writing to them.
    5·1 answer
  • Your classmate is frustrated because the code that was designed to add up her five quiz grades is not working properly.
    12·1 answer
  • Which web design concept is most closely related to elements that symbolize the real world​
    5·1 answer
  • Where is the BIOS stored?<br><br> CPU<br> CMOS<br> RAM<br> Northbridge
    13·2 answers
  • PLZZZ HELP!!!
    9·1 answer
  • Draw a flowchart diagram for a program that displays numbers 1 to 20
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!