#include<stdio.h>
void findfact(int num)
{
int i;
for(i=1;i<num;i++)
{
if(num%i==0)
printf("Factor for %d is %d\n",num,i);
}
}
main()
{
int a;
printf("\nEnter a number:");
scanf("%d",&a);
findfact(a);
}
Chat with our AI personalities
#include<stdio.h>
#include<conio.h>
main()
{
int c,n;
clrscr();
printf("\nenter the number:");
scanf("%d",&n);
c=1;
while(n%c==0)
{
pirntf("\nthe factor is=%d",c);
c=c+1;
}
getch();
}