Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1
Your logic is correct but not the code.... If you are trying recursive approch.... Then, Look at this, https://code.sololearn.com/cssuK09eoihG/?ref=app Your have following problem, 1) main function have return type int, then you should return 0, if you are returning any other value then it is redundant unless you are working on comlex application..... 2) your code do not handle case where b > a.... 3) gcd have return type int, so it should return some value to main, or it will warning.....
15th May 2020, 1:26 PM
DeWill
DeWill - avatar