The greatest common divisor, also known as GCD, is the greatest number that will, without a remainder, fully divide a pair of integers.   Now, I want you to make a program that will accept two integers and with the use of loops, print out their GCD. Make good use of conditional statements as well.    Input A line containing two integers separated b

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter4: Selection Structures
Section4.5: A Case Study: Solving Quadratic Equations
Problem 7E
icon
Related questions
Question
  1. Problem Description

The greatest common divisor, also known as GCD, is the greatest number that will, without a remainder, fully divide a pair of integers.

 

Now, I want you to make a program that will accept two integers and with the use of loops, print out their GCD. Make good use of conditional statements as well. 

 

Input

A line containing two integers separated by a space.

6·9

Output

A line containing an integer.

3

3. Problem Description
The greatest common divisor, also known as GCD, is the greatest number that will, without a
remainder, fully divide a pair of integers.
Now, I want you to make a program that will accept two integers and with the use of loops, print
out their GCD. Make good use of conditional statements as wellI.
Input
A line containing two integers separated by a space.
6.9
Output
A line containing an integer.
3
Transcribed Image Text:3. Problem Description The greatest common divisor, also known as GCD, is the greatest number that will, without a remainder, fully divide a pair of integers. Now, I want you to make a program that will accept two integers and with the use of loops, print out their GCD. Make good use of conditional statements as wellI. Input A line containing two integers separated by a space. 6.9 Output A line containing an integer. 3
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning