Ask Experts & Get Answers!!!
Friday, 28 June 2013
Write a C program to find all the factors of a given integer.
#include
<stdio.h>
#include
<conio.h>
void main( )
{
int
no,x;
printf(
"Enter the required number:"
);
scanf(
"%d"
,&no);
printf(
"\nThe factors are:"
);
for(x=1; x<=no; x++)
{
if(no%x==0)
printf("\n%d",x);
}
getch( );
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment