Answers for "c program to find divisors of a number"

0

c program to find divisors of a number

#include <stdio.h>
void main()

{
	int x, i;
	printf("\nInput an integer: ");
	scanf("%d", &x);

	printf("All the divisor of %d are: ", x);

	for(i = 1; i <= x; i++)
    {
            if((x%i) == 0)
            {
                printf("\n%d", i);
                printf("\n");
            }
	}

}
Posted by: Guest on June-03-2021

Code answers related to "c program to find divisors of a number"

Browse Popular Code Answers by Language