Write a java program to display Prime Number

import java.util.*;

public class PrimeNumber
public static void main(String args [])
Scanner sc = new Scanner(System.in);
int num1, num2;
System.out.println("Please enter the first number");
num1 = sc.nextInt();
System.out.println("Please enter the Second number");
num2 = sc.nextInt();
System.out.println("Prime number: ");
for (int i=num1; i <= num2; i++ ){
int j;
for (j=2; j<i; j++){
int n = i%j;
if (n==0){
if(i == j){
System.out.print(" "+i);

For more details about How to Earn Money Online please visit


College Projects with source code (PHP, .NET, JAVA, Visual Basic)

Pharmacy Management System in PHP and MySQL with Source Code

2018 Top WordPress Plugins for Business Websites

Top 10 Best Photo Editing Apps For Android

Best 2018 Android Hacking Apps

30 Best Free WordPress Blog Themes for 2017

Online Loan Management System

Car Rental System Using PHP

Online Jewellery Shopping System Php Project with source code

Online time table generation system in PHP

Online Examination System In PHP

PHP Website with DataBase As MySql

18 Ways to Earn Money Online from Home Without Investment

Online Survey Jobs: Earn from 20 Best Paid Survey Sites

Get Paid to Take Online Surveys for Money with 21 Best Sites

Top 10 Captcha Entry Job Sites

Best Get Paid to Offer & GPT Sites

Get Paid to Read & Click Ads from Best PTC Sites

How To Restore Your WordPress Website Backup On Local Server Using WAMP

Online Shopping System Using PHP and MySQL

Email server using PHP and MySQL

Hotel Reservation System In PHP

social media platforms Project In PHP

Crime Reporting System Project In PHP

Gmail Outlook Settings In Outlook 2016

Airlines Reservation System Java Project

Mail Server in PHP And MySQL

Online Examination System in PHP and MySQL

Student Information System using Vb and SQL

Payroll Management System In VB and SQL

Exam Seating Management System

Automation Inventory System in VB and SQL Server

School Management System

1 comment:

  1. Unfortunately your code isnt working, cause me and my friend try to do it a lot of times and nothing happened!( Then we go here and only after reading this article all start to work amazing!


Powered by Blogger.