Java Interface
Basic Accuracy: 32.3% Submissions: 1644 Points: 1

Like a class, an interface can have methods and variables, but the methods declared in interface are by default abstract (only method signature, no body).  

Given an inteface in1 which includes a method display which takes an integer as input .

interface in1
{
    void display(int p);
}

Task is to write a class testClass which implements interface in1 and has a method named display which takes an integer as input and total number of prime numbers between 2 and integer k (including it). Main function in written for you in the editor.

Input: 
The first line will contain an integer (number of test cases). Each test case consists of an integer n.

Output: 
Print total number of prime numbers between 2 and the given number ( including them ).

Constraints: 
1 < = T < = 1000
2<= n <= 104

Example:
Input:

2
13
19

Output:
6
8

to report an issue on this page.

Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes

All Submissions

My Submissions:

Login to access your submissions.