Programming language is C++ PA 8-2 (25 points) In mathematics the greatest commo
ID: 3748058 • Letter: P
Question
Programming language is C++
PA 8-2 (25 points) In mathematics the greatest common divisor (gcd) of two or more integers, which are not all zero, is the largest positive integer that divides each of the integers evenly. For example, the gcd of 8 and 12 is 4. For this assignment write a program that has the user enter two integers, then displays the GCD of those numbers. Include either a while or do-while loop. D:lCodeBlocks-EP1CodeBlocks-EPMarsh20501 binDebugMarsh2050.exe Enter first integer: 1072 Enter second integer: 832 The greatest common divisor for 1072 and 832 is 16Explanation / Answer
#include using namespace std; int main() { int n1, n2, gcd, i = 1; cout > n1; cout > n2; gcd = 1; while(iRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.