answersLogoWhite

0

/**

* @author BHARGAV MODI

*

*/

class prime

{

public static void main(String p[])

{

int i,j,s=0,d=0;

for(i=1;i<100;i++)

{

s=0;

for(j=1;j<=i;j++)

{

if(i%j==0)

s=s+1;

}

if(s==2)

{

System.out.println(i);

d=d+1;

}

}

System.out.println("the no. of prime no. are = "+d);

}

}

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

How do you write a VBnet program to find the prime numbers between 100 to 200?

VBnet program to find the prime numbers between 100 to 200?


Write a C program to find the sum of all prime numbers?

Since there is an infinite set of prime numbers the answer would be infinity.


Prime numbers between 1 to 10 in microprocessor 8085?

program to find prime number in 8085 microprocessor


When did Eratosthenes find prime numbers?

Eratosthenes lived between 276 and 194 B.C. He didn't discover prime numbers; he devised a simple way to determine what numbers are prime in a given range.


What is the total of the next eight prime numbers after twenty four?

Just go to a table of prime numbers, find the prime numbers, and add them.Just go to a table of prime numbers, find the prime numbers, and add them.Just go to a table of prime numbers, find the prime numbers, and add them.Just go to a table of prime numbers, find the prime numbers, and add them.


How can prime numbers be used in your everyday life?

Prime numbers are used to find the LCM of numbers Prime numbers are used to find the HCF of numbers Prime numbers are used to simplify fractions Prime numbers are used to find the LCD of fractions


How do you find sum of prime numbers below 70?

There is no simple answer because there is no known pattern for prime numbers. So the answer is to find all the primes below 70 and add them together. Sorry, but no short cut for this.


Write a program to print first 100 alternative prime numbers?

This would require some computer knowledge. It can make it easier to find out the prime numbers without figuring it out in your head.


How do you find prime number?

Prime numbers are the numbers that can only be divided by 1 and them selves. As in 13 if you were to factor it using only whole numbers you would see that its factors are only 1 and 13. There for it is prime. While 12 you see that the factors are 1,2,3,4,6,12 meaning that it is not prime.You test several numbers, to see whether they are prime numbers, until you find a prime number.


Which prime numbers can be mulitiplied to form?

Prime numbers are used to find the product of the prime factors of composite numbers.


How can you do prime factorization with prime numbers?

There is no need to do prime factorization as prime numbers are already prime. You do not need to find the prime numbers that when multiplied together create the number.


What type of numbers can you multiply to always find the LCM?

prime numbers, co-prime numbers