## GCD of two numbers:

The greatest common divisor (gcd), also known as the greatest common factor (gcf), or highest common factor (hcf), of two or more non-zero integers, is the largest positive integer that divides the numbers without a remainder. For example, the GCD of 8 and 12 is 4.

other examples: GCD of 12 & 18 is 6 , GCD of 9 and 12 is 3, GCD of 10 and 15 is 5

## Recurrsion:

A recursive function is a function which calls itself. For this to work, the following conditions apply :•There must be a solveable problem.

•There must be a terminating clause.

## write a c program to find GCD of two numbers using recursion or check gcd of two numbers using recursion or print gcd of two numbers using recursion or calculate gcd of two numbers using recursion or show gcd of two numbers using recursion

write a c program to find GCD of two numbers using recursion or check gcd of two numbers using recursion or print gcd of two numbers using recursion or calculate gcd of two numbers using recursion or show gcd of two numbers using recursion#include<stdio.h>

#include<conio.h>

int GCD (int a,int b)

{

if (a<0) a= -a;

if (b<0) b= -b;

if (a==0 || b==1 || a==b) return b;

if (a==1 || b==0) return a;

if (a>b) return GCD (b, a%b);

else return GCD (a, b%a);

}

void main()

{

int x,y;

clrscr();

printf("To calculate gcd of two numbers using recursion:");

printf("nEnter 1st number:");

scanf("%d",&x);

printf("nEnter 2nd number:");

scanf("%d",&y);

printf("\nGCD is:%d", GCD(x,y));

getch();

}

OUTPUT:

To calculate gcd of two numbers using recursion:

Enter 1st number: 8

Enter 2nd number:12

GCD is: 4

write a c program to find gcd of two numbers without recursion

other recursion programs

write a c program to find gcd using recursion

write a c program to find fibonacci numbers using recursion

write a c program to find factorial using recursion

write a c program to find sum of factorial series using recursion

write a c program to find reverse of a number using recursion