c Program to find Factors of a given number


Program to find Factors of a given number
Program
#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++;
}
}

No comments: