vagis used for creating an ordered it
las along with the
och by placing
<center>tas
b Square
orletter
bmp
<tr>
93
tag is used for making a piece of text as a separate block with extra
JILBANE On a web page
worksheet Tick the correct answer in the
which was helps you to centralize images on a web page?
Suche item in an unordered list is created using the
to the linked
which is not a type of bullet that can be inserted in a list using the cost
Whichatonbute of the cimg> tag is used to specify the location of an image!
which ta helps you to create a headercellinatable?
Answers
import java.util.Scanner;
public class FiftyPrimes
{
// Return true if a number n is prime
public static boolean isPrime(long n)
{
// Check division from 2 to sqrt(n)
for (long i = 2; i <= Math.sqrt(n); i++)
{
if (n % i == 0)
{
return false;
}
}
// If no division is found, number is prime
return true;
}
public static void main(String[] args)
{
// Create Scanner object
Scanner sc = new Scanner(System.in);
// Take user input
System.out.print("Enter the starting point: ");
long start = sc.nextInt();
// Close Scanner object
sc.close();
// If start point is less than 2, make it 2
if (start < 2)
{
start = 2;
}
int numberOfPrimes = 0; // Number of primes printed
long number = start; // Number to be tested for prime
// Iterate until 50 primes are printed
while (numberOfPrimes < 50)
{
if (isPrime(number))
{
System.out.println(number);
numberOfPrimes++;
}
number++;
}
}
}