answersLogoWhite

0

#include <iostream.h>

main()

{

int a;

cout<<"enter a number : ";

cin>>a;

cout<<endl;

if (a%2-1)

cout<<"it is a Prime number";

else

cout<<"it is not a prime number"

return 0;

}

------------------------------------------

output: enter a number : 30

it is a not a prime number

User Avatar

Wiki User

15y ago

Still curious? Ask our experts.

Chat with our AI personalities

ProfessorProfessor
I will give you the most educated answer.
Chat with Professor
SteveSteve
Knowledge is a journey, you know? We'll get there.
Chat with Steve
RossRoss
Every question is just a happy little opportunity.
Chat with Ross

Add your answer:

Earn +20 pts
Q: C plus plus code that determine prime number?
Write your answer...
Submit
Still have questions?
magnify glass
imp