fork download
  1. #include <iostream>
  2. using namespace std;
  3. int GCD(int a, int b)
  4. {
  5. int remaind = a%b;
  6. while(b!=0)
  7. {
  8. int remaind = a%b;
  9. a=b;
  10. b = remaind;
  11.  
  12. }
  13. return a;
  14.  
  15. }
  16. int main() {
  17. // your code goes here
  18. cout<<GCD(48,72)<<endl;
  19. return 0;
  20. }
Success #stdin #stdout 0.01s 5276KB
stdin
Standard input is empty
stdout
24