C Program to Find Factors Of A Given Number

How to write C Program to Find Factors Of A Given Number in C Programming Language ?

Solution For C Program :

/*C Program to Find Factors Of A Given Number*/

#include<stdio.h>
void main()
{
int x, n, sum;
printf("\nEnter the Number : ");
scanf("%d", &n);
x = 1;
printf("\nThe Factor's of %d are : ", n);
while(x <= n)
{
if(n % x == 0)
printf("%2d,", x);
x++;
}
}

You may also learn these C Program/Code :

C Program To Swap Two Numbers Without Using Third Variable


Learn More :