C Armstrong NumberC Average of N NumbersC Biggest of Three NumbersC Common DivisorsC Composite NumberC Condense a NumberC Even NumberC Factorial of a NumberC Fibonacci SeriesC GCDC LCMC Leap YearC Multiplication TableC Number CombinationC Odd NumberC Palindrome NumberC Perfect NumberC Prime FactorC Prime NumberC Sum of DigitsC Swapping Two Numbers

C Array ProgramsC Converter ProgramsC Star Patterns ProgramC Number Patterns ProgramC Alphabet Patterns ProgramA number that divides two or more numbers without remainder.

**Tips**: It is recommended to use our online common divisor calculator for better understanding.

The following table provides few examples of common divisors of the given numbers.

Numbers | Common Divisors |
---|---|

4, 6 | 1, 2 |

12, 24 | 1, 2, 3, 4, 6, 12 |

15, 25, 50 | 1, 5 |

In the following example, we will find the common divisors of numbers 12 and 24.

C Compiler

#include <stdio.h>
int main() {
int num1 = 12;
int num2 = 24;
int i, min;
min = (num1 < num2) ? num1 : num2;
printf("Common Divisors of %d and %d:\n", num1 , num2);
for(i=1; i<=min; i++)
{
if((num1 % i == 0) && (num2 % i == 0))
printf("%d ", i);
}
return 0;
}

In the following example, we will find the common divisors of any two given numbers.

C Compiler

#include <stdio.h>
int main() {
int num1, num2, i, min;
printf("Enter (int) num1 = ");
scanf("%d", &num1);
printf("Enter (int) num2 = ");
scanf("%d", &num2);
min = (num1 < num2) ? num1 : num2;
printf("\nCommon Divisors of %d and %d:\n", num1 , num2);
for(i=1; i<=min; i++)
{
if((num1 % i == 0) && (num2 % i == 0))
printf("%d ", i);
}
return 0;
}

Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.

This channel is primarily useful for Full Stack Web Developer.