I wrote a program to get first 100 no. which are divisible by 3. Heres the code
import java.io.*;
class app
{
public static void main (String args[])
{
for(int i=0; i<=100; i++)
{
int x;
try{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter your no.");
x= Integer.parseInt(br.readLine());
if(x%3==0)
{
System.out.println("The no. you entered is divisible by 3");
}
else
{
System.out.println("Not");
}
}
catch(Exception e)
{
System.out.println("Problem with the program");
}
} }
}
Somehow it is not working please provide with the correct program