Public feed #377572

Miscellany

public cpp v1 · immutable
Raw Edit
·published 2007-03-01 21:20 UTC
rendered paste body
int GCD(int x, int y) //will find greatest common divisor of three numbers{  int r;while(true) //loops while r is not equal to 0{r= y % x; //finds remainder of y / x and stores it in variable rif(r == 0) //returns value of x if r is equal to 0return x;else //if r is not eqaul to 0, y gets value of x and x gets value of ry=x;x=r; } }