int main ( int argc, char **argv ) { int p = atoi(argv[1]), q = atoi(argv[2]), r; while ( r=p%q ) q=(p=q, r); printf("%d\n", q); }