In which language -java or basic?
void main(int n)
int no_fac,;// no_fac represents no. of factors
int lo_va;// lo_va represents loop variable
no_fac=0;// no. of factors is initially zero
if(n%lo_va==0)// this means "if lo_va is a perfect factor of n"
no_fac++;//no. of factors is increased by 1
if(no_fac==2)//only a prime no. has 2 factors, rest all have more than 2
System.out.println("It is a prime no.");
System.out.println("It is not a prime no.");