Computer Science, asked by jaishrijain1977, 11 months ago

write a java program to input a number and check whether it is a prime number or not​

Answers

Answered by iamnoblethomasgeorge
2

Explanation:

{int n=integer.parseIbt....

for (int i=1;i<n;i++)

if (n%i==0)

{sopln("composite")

break;}

elseif (n <=1){sopln("negative")}

else{sopln("0")}}

Similar questions