not entirely sure what your trying to do still, im a bit hungover yet but:
Code:
#include <iostream>
using namespace std;
int main()
{
int num1;
int num2;
int result;
cout << " please input the first number, the larger of the two" endl;
cin >> num1;
cout << "please input the second number, the smaller of the two" endl;
cin >> num2;
result = num1 % num2;
cout << " the modulus of the two numbers is" << result << endl;
return 0;
}
totally not sure if thats what your after but tis a frame for doing anything
you could use loops for your function for finding the modulus, i have a clue about factors and Highest common factors, and multiples, but with an example i coudl probably sort it
Code:
while (y > 0 || y == 0)
{
//do your stuff in here
}
another thing you could do would be to have a counter, in these HCF and LCM thigsn we did at school it was usefull to fidn out how many times one divided into another then multiply it by somethign else to find some pointless number, so you could encorporate:
Code:
while (y > 0 || y == 0)
{
int count = 0;
//do your stuff in here
count++
}
that would get you a number of how many tiems it did whatever you wanbt before the number got down to one.
still not totally sure i know what your after, but with a little more info it should be easy