#include <iostream>
usingnamespace std;
int gcf(int (&numOne),int (&numTwo));
int main()
{
int numOne, numTwo;
cin >> numOne >> numTwo;
gcf(numOne, numTwo);
return 0;
}
int gcf( int (&numOne), int (&numTwo))
{
int i;
int result = 0;
for(i = 1; i <= numOne && i <= numTwo; i++)
{
if( numOne % i == 0 && numTwo % i == 0)
result = i;
}
cout << result;
return 0;
Thank you for the help, can you please do this one I don't know how to do it:
write a function that receives an positive integers x, and then display following matrix:
11 12 13...1x
.
.
x1 x2 x3...xx
For example ,if the number that the function receive is 4, then the function should display a matrix as following:
11 12 13 14
21 22 23 24
31 32 33 34
41 42 43 44
#include <iostream>
usingnamespace std;
int main()
{
int x;
cin >> x;
for (int y = 1; y <= x; ++y)
{
for (int z = 1; z <= x; ++z)
{
cout << y << z << " ";
}
cout << "\n";
}
return 0;
}
can you please help me doing this too, I really appreciated your help
Write a function that receives a positive integer and has no return value. The function should print out all the primes that less than or equal to the number it receives. For example, if the number the function receives is 17. Then it should print out a list of the following numbers: 1, 2, 3, 5, 7, 11, 13, 17.