Computer Science, asked by Sharukh507, 3 months ago

write a program to check it is a prime number or no
plz sns​

Answers

Answered by Anonymous
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
Sharukh507: tommorow exam is there
Anonymous: you are in 10th or 12th ?
Sharukh507: 10
Anonymous: in c++ ?? or java
Sharukh507: c++
Anonymous: ok wait
Sharukh507: :)
Anonymous: ok done
Sharukh507: Thanks :)
Answered by ramkeshigntu1996
0

Explanation:

caut<<''prime"and program to chekit


Sharukh507: please don't spam guys
Sharukh507: it is cout not caut
Similar questions