Extended Euclid Algorithm

Why the code is showing compilation error

#include<stdio.h>
#include
using namespace std;
int x, y, GCD;
void extendedEuclidMethod(int a, int b){
if(b == 0){
GCD = a;
x = 1; y = 0;
}
//Recursive call
extendedEuclidMethod(b, a%b);
int cx = y;
int cy = x - (a/b)*y;

x = cx;
y = cy;

return ;

}
int gcd(int a, int b){
return (b == 0) ? a: gcd(b, a%b) ;
}
int main() {
extendedEuclidMethod(18, 30);
cout<<x<<" "<<y<<endl;

return 0;

}

Please send your code in CB IDE. Its easier to debug then.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.