29 lines
332 B
C
29 lines
332 B
C
/*
|
|
* Student: S.K. Soekhlal
|
|
* Number: 4860632
|
|
* Assignment: 3.4
|
|
*/
|
|
|
|
#include<stdlib.h>
|
|
#include<stdio.h>
|
|
|
|
int gcd (int p, int q)
|
|
{
|
|
int r,t;
|
|
while (q > 0)
|
|
{
|
|
r = p%q;
|
|
p=q;
|
|
q=r;
|
|
}
|
|
return p;
|
|
}
|
|
|
|
|
|
|
|
int main(){
|
|
int a,b;
|
|
scanf("%d%d",&a,&b);
|
|
printf("%d\n",gcd(a,b));
|
|
return 0;
|
|
} |