C Program to find a factors of an integer - c programs
//Write a C Program to find a factors of an integer - print factors of a number
#include<stdio.h>
#include<conio.h>
{
void main( )
{
int no,x;
clrscr( );
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( );
}
#include<stdio.h>
#include<conio.h>
{
void main( )
{
int no,x;
clrscr( );
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