#include<iostream>
#include<conio.h>
using namespace std;
int main()
{ int num,p=0,count=0;
int array[10]={1,2,3,4,5,6,7,8,9,10};
for(int a=0; a<10; a++)
{
for(int c=2;c<=array[a]/2;c++)
{if(array[a]%c==1)
{
p=1;
break;}}
if(p==0)
count++;}
cout<<"PRIME NUMBERS IN ARRAY ARE "<<count;
getch();
}
#include<conio.h>
using namespace std;
int main()
{ int num,p=0,count=0;
int array[10]={1,2,3,4,5,6,7,8,9,10};
for(int a=0; a<10; a++)
{
for(int c=2;c<=array[a]/2;c++)
{if(array[a]%c==1)
{
p=1;
break;}}
if(p==0)
count++;}
cout<<"PRIME NUMBERS IN ARRAY ARE "<<count;
getch();
}
mmmm yah program ghalat nahi ? :3
ReplyDeleteyah 6 ko bhi prime number hi show nahi kary ga ?
ReplyDeletethank you aqib bhai....ab check krn....
Delete