write a program to check it is a prime number or no
plz sns
Answers
Answered by
5
#include<iostream.h>
#include<conio.h>
void main ()
{
clrscr();
int count =0;
int i;
cout<<"enter number to check prime or not ";
cin>>n;
for(i=0;i<n;i++)
{
if(n%2==0)
{
count++;
}
}
if(count==2)
{
cout<<"prime";
}
else
{
cout<<"not prime";
}
getch();
}
Sharukh507:
please edit and write full program
Answered by
0
Explanation:
caut<<''prime"and program to chekit
Similar questions
Political Science,
1 month ago
Computer Science,
1 month ago
Physics,
10 months ago
English,
10 months ago