I'm new to C programming
I'll try to write the program, but I don't even know what the program is asking me to write
The greatest common divisor of integers x and y is the largest integer that evenly divides both x and y. Write a recursive function gcd taht returns the greatest common divisor of x and y. The gcd of x and y is defined recursively as follows: If y is equal to 0, then gcd(x,y) is x; otherwise gcd(x,y) is gcd(y,x%y) where % is remainder operator.
heres my attempt at this program, not a very good 1 cuz i barely understand the program i need to write
Code:#include <stdio.h> long gcd (long gcd) int main() { int x,y,i; for (i=0; i<=100; i++) { printf("Enter 1st integer\n"); scanf("%d",&x); printf("Enter 2nd integer\n"); scanf("%d",&y); } return 0; } long gcd (long gcd) { if (y==0) { printf("gcd(x,y) is %d\n", x); } else { printf("gcd(x,y) is gcd(%d,%d %% %d\n", y,x,y); } return 0; }