Hazecraft Client Series (Vardhan Raju)

 import java.util.Scanner;

public class Main{
    public static void main(String[] args){          
           //Fill your code
         Scanner sc = new Scanner(System.in);

         int N=sc.nextInt();

         int count=0,n=0,i=1,j=1;

         while(n<N)

         {

                     j=1;

                     count=0;

             while(j<=i)

         {

                 if(i%j==0)

                 count++;

                 j++;

         }

                 if(count==2)

         {

                 System.out.printf("%d ",i);

                 n++;

         }

            i++;

         }

             }

         }
Tags

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.