What do you mean by recursion? Write down a C function to find out the GCD of two nos. using recursive technique.
Recursion is a programming technique that allows the programmer to express operations in terms of themselves. In C, this takes the form of a function that calls itself.
C function to find out the GCD of two nos. using recursive technique.
#include <stdio.h>
int gcd(int n1, int n2);
int main()
{
int n1, n2;
printf("Enter two positive integers: ");
scanf("%d%d", &n1, &n2);
printf("G.C.D of %d and %d = %d", n1, n2, gcd(n1,n2));
return 0;
}
int gcd(int n1, int n2)
{
if (n2!=0)
return gcd(n2, n1%n2);
else
return n1;
}
What is a B-Tree? Show how the letters A to P English alphabet can be entered into a B-tree of order 4.
"Write an algorithm to test whether a given binary tree is a binary search tree."
Write a C program to transpose of a matrix.
Write the recursive algorithm to find x^ n.
What are Halstead’s metrics?
What is “Top-Down and Bottom-Up Design” approach?
What is linear searching?