Program description:
In this program we will find out the factors of a number entered by the user. It is a simple yet interesting program.
Source Code:
#include<stdio.h>
int main()
{
int n,i,fact;
printf("Enter the number to find out the factors:");
scanf("%d",&n);
printf("The factors of %d are: ",n);
for(i=1;i<=n;i++)
if(n%i==0)
printf("%d ",i);
printf("\nThank You");
}
0 Comments