answersLogoWhite

0


Best Answer

#include<iostream>

using namespace std;

int gcf(int a, int b)

{

int t;

while(b!=0)

{

t = b;

b = a%b;

a = t;

}

return a;

}

int main()

{

int a,b,c,d,e,f,g,h,i,j,k;

cout<<"Enter 1st numbers: ";

cin>>a;

cout<<"Enter 2nd numbers: ";

cin>>b;

cout<<"Enter 3rd numbers: ";

cin>>c;

cout<<"Enter 4th numbers: ";

cin>>d;

cout<<"Enter 5th numbers: ";

cin>>e;

cout<<"Enter 6th numbers: ";

cin>>f;

cout<<"Enter 7th numbers: ";

cin>>g;

cout<<"Enter 8th numbers: ";

cin>>h;

cout<<"Enter 9th numbers: ";

cin>>i;

cout<<"Enter 10th numbers: ";

cin>>j;

k=gcf((((((((gcf(a,b),c),d),e),f),g),h),i),j);

cout<<"The GCD of the 10 numbers is: "<<k<<endl;

system("pause");

return 0;

}

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Program in c plus plus that accepts 10 input integer and to get the Greatest common divisor?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the greatest remainder you could have with the divisor 8?

The greatest integer remainder is 7 but otherwise, 7.999... .


What is the greatest possible remainder if the divisor is 63?

The greatest integer remainder for a division sum with a divisor of 63 would be 62 - for a number one fewer than an integer multiple of 63 - for example, 125/63 = 1 remainder 62.


What is the greatest common divisor of 6A?

Cannot be answered because in math, the greatest common divisor (GCD) of two or more non-zero integers, is the largest positive integer that divides the numbers without a remainder.


What is the greatest common divisor of 11?

Cannot be answered because in math, the greatest common divisor (GCD) of two or more non-zero integers, is the largest positive integer that divides the numbers without a remainder.


What is the greatest common divisor of 120?

Cannot be answered because in math, the greatest common divisor (GCD) of two or more non-zero integers, is the largest positive integer that divides the numbers without a remainder.


How do you find the greatest integer plotted plotted on a number line?

you need to dryer the four and use the divisor of your answer dress and i went to this numbered


What is always the result of dividing an integer when the divisor is nonzero?

A rational number is always the result of dividing an integer when the divisor is nonzero.


Why do you have to learn about greatest common divisors?

In math, the greatest common divisor (GCD) of two or more non-zero integers, is the largest positive integer that divides the numbers without a remainder.


Integer that is an exact divisor?

is called a factor.


If you divide -20 by an integer and get 4 as the answer what was the divisor?

-5


What is GCD in elementary -school textbooks?

GCD = Greatest Common Divisor = Greatest Common Factor = GCF The greatest common factor, or GCF, is the largest positive integer that will divide evenly with no remainder into all the members of a given set of numbers.


Division by an integer is always defined?

Division by an integer is always defined only when the divisor is not zero