Brijmohan lal Sahu - Facebook
Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Monday, November 3, 2014

Program to find factor of any number in C.




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: