answersLogoWhite

0


Best Answer

where to start? do you have an algorithm and just want to implement it in java? depends on how big N is, as that will determine which method is most efficient

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How to write a java program that determines the number of prime numbers less than N which is given by the user?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Shell program for gcd of three given numbers?

write a shell program for finding out gcd of three given numbers? write a shell program for finding out gcd of three given numbers? write a shell program for finding out gcd of three given numbers? check bellow link http://bashscript.blogspot.com/2009/08/gcd-of-more-than-two-numbers.html


C program to fine the largest of 10 given number?

first sort the ten numbers in descending order and print the first number. That will be the largest no


What determines the frequency of the wave?

The number of cycles in a given time. :)


The frequency of wave determines?

The number of cycles in a given time. :)


How do you find the missing number in a set of numbers where the average is given?

The average of a set of numbers is defined as the sum of those numbers divided by the number of numbers. If the average is given, multiply that by number of items in the set including the missing number. Subtract the sum of given numbers from this quotient and the missing number is revealed.


Is the scale on a graph the numbers?

Yes, the numbers on the X-axis and the Y-axis are the scale. The scale determines the value of any given point.


Write a program for which give number in ascending number?

the following program will display all numbers given in the array in ascending order #include<stdio.h> void main() { int i,h,p; int numbers[10]={5,8,3,2,6,7,9,4,1,10}; for(p=0;p<=8;p=p+1) { for(i=0;i<=8;i=i+1) { if(numbers[i]>numbers[i+1]) { a=numbers[i]; numbers[i]=numbers[i+1]; numbers[i+1]=a; } } } for(i=0;i<=9;i=i+1) { printf("%d ",numbers[i]); } }


Frequency of a sound wave determines?

The number of cycles in a given time. :)


How do you get the set of multiples of a given number?

Multiply the given number by successive counting numbers.


What determines the mass of an isotope?

The number of neutrons in the nucleus, the number of protons is the same for each isotope of a given element.


How to find the smallest number?

When you are given some numbers just arrange them in ascending order and you will the smallest number which can be made out of those given numbers.


How do you generate palindrome number between the given range?

The generation of palindromic numbers within a given range is best done with a computer program. Space it limited so an example of program code cannot be shown here, but the Codecast website gives full guidance.