#include<stdio.h>
int main()
{
int a[]={2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127};
int i=0,n;
printf("enter any even number for which prime factorisation has to be foundn");
scanf("%d",&n);
printf("n the prime factorisation of a given number is n");
while(n!=1)
{
if(n%a[i]==0)
{
printf("n%d",a[i]);
n=n/a[i];
}
else
{
i=i+1;
}
}
getch();
}
Responses
0 Respones to "program to find prime factorisation of a given number"
Post a Comment