A Program That Read Two numbers & Display GCD (Greatest Common Divisor).

#include<stdio.h>
#include<conio.h>
#include<iostream.h>

void main()
{
    int a,b;
    clrscr();
    cout<<"Enter 1st number = ";
    cin>>a;
    cout<<"Enter 2nd number = ";
    cin>>b;
   
    while(a%b!=0)
    {
       int c=a%b;
       a=b;
       b=c;
    }
   
    cout<<"Greatest Common Divisor(GCD) = "<<b;

    getch();
}

///////////////////////////////////////////////////////////////////////////
Copy & paste this code in your TC & run, then you will get output.......
If you have any problem please comment below.........