Activity

  • kamal Kumar posted an update in the group Group logo of java Programmerjava Programmer 5 months, 4 weeks ago  · 

    Program to print prime numbers in java

    public class primenumbers {

    public static void main(String[] args) {

    int num=50;
    int count=0;

    for(int i=2;i<=num;i++){

    count=0;

    for(int j=2;j<=i/2;j++){

    if(i%j==0){
    count++;
    break;
    }

    }

    if(count==0){

    System.out.println(i);

    }

    }

    }

    }