#include<stdio.h>
int gcd(int a, int b)
{
if (b == 0)
return a;
return gcd(b, a % b);
}
int main()
{
int a,b;
Printf(“Enter the values of a and b\n”);
Scanf(“%d %d”,&a,&b);
printf("GCD of %d and %d is %d ", a, b, gcd(a, b));
return 0;
}
#include<stdio.h>
int gcd(int a, int b)
{
if (b == 0)
return a;
return gcd(b, a % b);
}
int main()
{
int a,b;
Printf(“Enter the values of a and b\n”);
Scanf(“%d %d”,&a,&b);
printf("GCD of %d and %d is %d ", a, b, gcd(a, b));
return 0;
}
0 Comments