The document contains 4 C++ programs that take input, perform while loops to find the greatest common divisor (GCD) of inputs, and output results. Program 1 finds the GCD of inputs a and b and outputs their product divided by the GCD. Program 2 finds the GCD of inputs a and b and outputs b and their product divided by the GCD. Program 3 finds the GCD of inputs a, b, and c and outputs the GCD. Program 4 finds the GCD of inputs x and y and outputs "DA" if the GCD is 1, and "NU" otherwise.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
107 views4 pages
CMMDC, CMMMC
The document contains 4 C++ programs that take input, perform while loops to find the greatest common divisor (GCD) of inputs, and output results. Program 1 finds the GCD of inputs a and b and outputs their product divided by the GCD. Program 2 finds the GCD of inputs a and b and outputs b and their product divided by the GCD. Program 3 finds the GCD of inputs a, b, and c and outputs the GCD. Program 4 finds the GCD of inputs x and y and outputs "DA" if the GCD is 1, and "NU" otherwise.