Im trying to get the greatest common factor for 2 numbers

you have the user enter the first number

then you have the second entered by the user

this is my basic formula and i haven't been doing this for a while so any help would be greatly appreciated.

All I really need is a basic formula to get it to work

#include<iostream.h>

int main()

{

int first,second;

cout<<"Enter the first number ";

cin>>first;

cout<<"Enter the second number ";

cin>>second;

if (first==second || second==first)

cout<<"The Greatest Common Factor is "<<second<<endl;

if(first>second)

cout<<"The Greatest Common Factor is " <<

if(second>first)

cout<<"The Greatest Common Factor is " <<

return(0);

}