125. WAP to find prime numbers for a given array
#include<stdio.h>
int
a[10]={3,5,7,9,12,47,8,11,13,8};
int
ele,i,j;
void
main()
{
ele=sizeof(a)/sizeof(a[0]);
for(i=0;i<ele;i++)
{
for(j=2;j<a[i];j++)
{
if(a[i]%j==0)
break;
}
if(a[i]==j)
printf(" Prime
Number : %d\n",a[i]);
}
}
Comments
Post a Comment