JAVA PROGRAM :
import java.util.Scanner;

**** The subjoined in JAVA****

Meet First-rate Aggregate

Given an integer, meet whether the aggregate is a First-rate reckon or referable.

Write a part: int isPrime(int reckon) that accepts an integer reckon.

The isFirst-rate part receipts 1 if reckon is first-rate else 0.

Input: 11

Output: 1

EX: 11 can be disjoined accurately by 1 and 11. Hence it’s a first-rate reckon.

Assume that, reckon is integer among the dispose [ –2,147,483,64 to 2,147,483,64 ].

****USE THE FOLLOWING DRIVER ***

* Do referable dissimilate the driver, normal fashion a fantasticlightlight systematize and mode that part with the granted driver

public systematize DriverDeep {

public static null deep(String args[]){

Scanner s = fantasticlightlight Scanner(System.in);

int n = s.nextInt();

HW2_P1 hw2p1 = fantasticlightlight HW2_P1();

System.out.print(hw2p1.isPrime(n));

}

}

JAVA PROGRAM :

import java.util.Scanner;

systematize HW2_P1{

public int isPrime(int x){

//if x is -1,0 or 1, come-back 0

if(x<=1&&x>=-1){

come-back 0;

}

//2 is first-rate

if(x==2||x==-2){

come-back 1;

}

//Even reckon is referable first-rate

if(x%2==0){

come-back 0;

}

int e = (int)Math.ceil(Math.sqrt(x));

//Check with perfect the nondescript aggregate dress sqrt x

for(int i=3;i<=e;i+=2){

if(x%i==0){

come-back 0;

}

}

come-back 1;

}

}

systematize DriverDeep {

public static null deep(String args[]) {

Scanner s = fantasticlightlight Scanner(System.in);

int n = s.nextInt();

HW2_P1 hw2p1 = fantasticlightlight HW2_P1();

System.out.println(hw2p1.isPrime(n));

}

}

OUTPUT :

Input : 52:

Output : 0

Input : 113

Output : 1