In this tutorial, we are going to make a C Program to Print Factors of a given number with step by step full complete explanation.
C Program to Print Factors of a given number
#include<stdio.h>
#include<conio.h>
void main()
{
int input, i;
printf("Enter any number:");
scanf("%d",&input);
for(i=1; i<=input; i++)
{
if (input%i ==0)
printf("%d, ",i);
}
getch();
}