C program to calculate the product of two numbers using recursion C program to find the HCF (Highest Common Factor) of given numbers using recursion C program to find the LCM (Lowest Common Multiple) of given numbers using recursion C program to find the GCD (Greatest Common Divisor) of giv...
n2 : -n2; while(n1!=n2) { if(n1 > n2) n1 -= n2; else n2 -= n1; } printf("GCD = %d",n1); return 0; } Output Enter two integers: 81 -153 GCD = 9 You can also use recursion to find the GCD.Share on: Did you find this article helpful?
The above program takes input from the user and stores it in the variable n. Then, for loop is used to calculate the sum up to n. Sum of Natural Numbers Using while Loop #include <stdio.h> int main() { int n, i, sum = 0; printf("Enter a positive integer: "); scanf("%d",...
Power using Recursion in C C Program to Calculate the Power using Recursion Product of two Numbers using Recursion in C C Program to Find Product of Two Numbers using Recursion Product of two Numbers without Recursion in C C Program to Find Product of Two Numbers without Recursion Nth Fibonacci...
Simple C Program to copy contents of one file into another file in C language using file handling functions and concepts with stepwise explanation.
C Program to Convert Binary Number to Octal and vice-versa C program to Reverse a Sentence Using Recursion C program to calculate the power using recursion Array and Pointer C Program to Calculate Average Using Arrays C Program to Find Largest Element of an Array ...
C Program to find GCD of two numbers C Program to find LCM of two numbers C Program to check whether number is prime or not C Program to count number of digits in an integer C Program to calculate the power of a number C Program to print prime numbers from 1 to 100 (1 to N) ...
118. Print Pattern Using C 08:38 119. C Program to Print Pyramid Pattern Using _ 10:32 120. Learn to make Program to Calculate 100 Factorial (0 to 100) in C 12:56 121. How to program pyramids using loops - 5 19:59 122. C Tutorial 29 - Reading and Writing to Files - fs...
Added Program to calculate Modular Exponents Quickly finding the first missing natural number Finding the first missing natural number gcd.c updated gcd.c file with better functionality getPIDs.c added a program to get all PIDs that is used by parent and child in a… heap sort.c fixed the...
Celsius to Fahrenheit Simple Interest Greatest Common Divisor(GCD) MISCELLANEOUS-2 Roots of Quadratic Roots Identifying a Perfect Square Calculate nPr and nCr Windows Shutdown Without Main Function Menu Driven Program Changing Text Background Color Current Date and Time Related Tutorials C Tutorials ...