Wednesday, March 13, 2013

Prime Number series



public static void main(String[] args) {
int f,i,j ;
    System.out.println("LIST OF PRIME NUMBERS FORM 1 TO 50/N");
    for(i= 2;i<=50;i++)
    {
    f = 0;
    for(j=2;j<i;j++)
    {
 
      if(i% j==0)
            f=1;
    }
    if(f==0)
        System.out.println(i);
    }
   
    }
}

No comments:

Post a Comment

  A Potential Showdown: Kamala Harris vs. Donald Trump As the political landscape gears up for the next election cycle, the prospect of a fa...