Code Box
-----------------------------------
/* Program to find factor of any number */
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int num,i;
printf("\n---------Factor Finder--------");
printf("\nEnter a number:");
scanf("%d",&num);
printf("\nFactors of %d are : ",num);
for(i=1;i<num;i++)
{
if(num%i==0)
{
printf(" %d",i);
}
}
getch();
}
No comments:
Post a Comment