This is my probem: my code should work. in fact, for small numbers it does. (like 2 and 2). but it isnt working, and it gives me one of those "microsoft error" things. please help me.
Code:#include <iostream> #include <math.h> #include <string.h> using namespace std; int main(){ int a, b, c, x, y, z; int big [100]; int small [100]; z=1; cout<<"what are the two numbers?\n"; cin>>a>>b; if(a>b){ x=a; } if(a<b){ x=b; } for(; x<100;x--){ if((a%x==0)&&(b%x==0)&&(x>z)){ z=x; } } cout<<z; cin.get(); cin.get(); }



LinkBack URL
About LinkBacks


