#include <stdio.h>
#include <conio.h>
void main()
{
int flag,i,n,r,a[100],b,s;
clrscr();
printf("\n Enter Number: ");
scanf("%d",&n);
printf(" Facrtors are: 1 %d ",n);
for(i=2;i<=n/2;i++)
{
r=n%i;
if(r==0)
{
flag=s;
a[b]=i;
b++;
printf("%d ",i);
}
}
if(flag==s)
{
printf("\n So The Number %d is not prime",n);
}
else
{
printf("\n So The Number %d is prime",n);
}
getch();
}
#include <conio.h>
void main()
{
int flag,i,n,r,a[100],b,s;
clrscr();
printf("\n Enter Number: ");
scanf("%d",&n);
printf(" Facrtors are: 1 %d ",n);
for(i=2;i<=n/2;i++)
{
r=n%i;
if(r==0)
{
flag=s;
a[b]=i;
b++;
printf("%d ",i);
}
}
if(flag==s)
{
printf("\n So The Number %d is not prime",n);
}
else
{
printf("\n So The Number %d is prime",n);
}
getch();
}
No comments:
Post a Comment