Java program....using fall through....
Attachments:
Answers
Answered by
2
public class fall
{
public void main (int n)
{
int i,c=0,t=n;
for (i=1;i<=n;i++)
if(n%i==0)
{
c++;
}
if (c==2)
sopln ( t+"is not prime");
else
sopln(t+"is prime");
}}
{
public void main (int n)
{
int i,c=0,t=n;
for (i=1;i<=n;i++)
if(n%i==0)
{
c++;
}
if (c==2)
sopln ( t+"is not prime");
else
sopln(t+"is prime");
}}
srivastavasuyaoyskop:
Ishita this one is done in the copy....they both are same...
Similar questions