Category Archives: C Programs by Recursion

4 C Programs Find GCD and LCM

Topic: 4 C Programs Find GCD and LCM The Greatest Common Divisor – GCD The greatest common divisor (GCD) of two integers is the largest positive integer dividing both. In mathematics, the greatest common divisor (gcd) of two or more integers, is the largest positive integer that divides each of the integers. For example, the… Read More »

Loading

C Program Sum of One to N by Recursion

C Program Sum of One to N by Recursion /*C Program To Add all natural numbers 1 to N Using Recursion */ #include <stdio.h> /* Function prototype */ int sumNumbers(int n); /* main function */ int main() { int num; printf(“Enter a positive integer\nto add all numbers upto: “); scanf(“%d”, &num); printf(“Sum of Numbers Upto… Read More »

Loading