#include<iostream.h>
void main()
{
int a,b,r;
cout<<"a=";cin>>a;
cout<<"b=";cin>>b;
while (r!=0)
{
r=a%b;
a=b;
b=r;}
cout<<"cmmdc="<<a;
pty commented: Try reading your error messages -2

woaw, how could i not think about that? thanks sherlock!

You're welcome, glad I could be of service.

commented: Fresh eyes, old professor. +12
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.