C Program to Find Denominator of Given Amount

C Program to Find Denominator of Given Amount

Write C Program to Find Denominator of Given Amount

//C Program to Find Denominator of Given Amount

#include <stdio.h>

int main()
{
	int n;

	printf("Enter the Amount :--> ");
	scanf("%d",&n);

	int div = 1;

	printf("The Denominator of the Given Amount is :--> ");

	while(div < n)
	{
		if(n % div == 0)
		{
			printf("%d ", div);
		}
		div++;
	}
	return 0;
}

Output:

Enter the Amount :--> 30
The Denominator of the Given Amount is :--> 1 2 3 5 6 10 15