Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int a, b, p, r, cmmdc;
- //cmmmc[x,y]=(x*y)/cmmdc(x,y)
- cout<<"a="; cin>>a;
- cout<<"b="; cin>>b;
- p=a*b;
- if(a==0 || b==0)
- cout<<"Cmmmc=0";
- else
- {
- do
- {
- r=a%b;
- a=b;
- b=r;
- }
- while(r);
- cmmdc=a;
- }
- int cmmmc=p/cmmdc;
- cout<<"CMMMC este:"<<cmmmc;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement