Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

#include<stdio.h> #include<conio.

h> void main() { int i,j,n,count; clrscr(); printf("enter a number to check its prime factors"); scanf("%d",&n); printf("the prime factors are :"); for(i=1;i<=n;i++) { count=0; for(j=1;j<=i;j++) { if(i%j==0) count++; } if(count==2) { if(n%i==0) printf("%d",i); } } getch(); }

You might also like