#include<stdio.h>//header file
#include<conio.h>//header file
void main() //starting of the main() function
{
int i=2,b=0,a[20],p,n,m; //declaration of the variables
clrscr();
printf("program that gives all positive factors of a given (+)ve no.");
printf("\n\n\n\t\t------------INPUT-------------");
printf("\n\nenter the no. who's factors are to be calculated");//taking input
from the user
scanf("%d",&n);
p=n;
while(p>=i)
{
if(p%i==0)
{
a[b]=i;
b++;
while(p%i==0)
p=p/i;
}
i++;
}
a[b]=1;
printf("\n\n\n\t\t------------OUTPUT------------");
printf("\n\nthe factors of %d are=",n);//printing output
for(m=0;m<=b;m++)
printf("\t%d",a[m]);
getch();
}