/* Program to find the greatest common divisor
 * of two nonnegative integer values */

#include <stdio.h>

int main()
{
	/*delaring variables*/
	int u, v, temp;

	/*Ask the user to enter two nonnegative integers*/
	printf("Please enter two nonnegative integers.\n");
	scanf("%i%i", &u, &v);

	while( v != 0 )
	{
		temp = u % v;
		//printf("temp: %i\n", temp);
		u = v;
		//printf("u: %i\n", u);
		v = temp;
		//printf("v: %i\n", v);
	}
	printf("Their gretest common divisor is %i\n", u);
	return 0;
}