answersLogoWhite

0


Best Answer

// Print Prime number series.

class prime

{

void main ()

{

int i = 1;

int C = 0;

int n = 1;

int X = 0;

while (X != 1000)

{

if ( n % i n )

{

C = 0;

n++ ;

i = 0;

}

}

i++ ;

}

}

}

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Prints the 1000th prime number
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

C plus plus code that determine prime number?

#include <iostream.h> main() { int a; cout<<"enter a number : "; cin>>a; cout<<endl; if (a%2-1) cout<<"it is a prime number"; else cout<<"it is not a prime number" return 0; } ------------------------------------------ output: enter a number : 30 it is a not a prime number


In java using command line argument write prime number program?

/* Program to print prime numbers up to given number */ import java.util.*; public class Prime { public static void main(String args[]) { Scanner sc=new Scanner(System.in); System.out.println("Enter the number : (it prints prime numbers upto your given number)"); int n=sc.nextInt(); System.out.println("The Prime number upto "+n+" are : "); while (n>=0) { int count=0; for (int i=1;i<=n ;i++) { if (n%i==0) { count++; } } if (count==2) { System.out.print(n+" "); } n--; } } }


Is 59 a composite number?

No 59 is a prime number because only 1 and itself can go into it.


Is 29 a composite number?

29 is not a composite number; it is a prime number.


Java program that prompts the user for an integer and then prints out all prime numbers upto that number?

import java.io.*; class PrimeNumber { public static void main(String[] args) throws Exception { int i; BufferedReader bf = new BufferedReader( new InputStreamReader(System.in)); System.out.println("Enter number:"); int num = Integer.parseInt(bf.readLine()); System.out.println("Prime number: "); for (i=1; i < num; i++ ){ int j; for (j=2; j<i; j++){ int n = i%j; if (n==0){ break; } } if(i == j){ System.out.print(" "+i); } } } } output: Enter number: 50 Prime number: 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47BUILD SUCCESSFUL (total time: 3 seconds)

Related questions

What is the 1000th prime number?

7919.


What is the 1001st prime number?

The 1000th is 7919, so the 1001st is 7927.


What is my number my number is a perfect square the only prime number and it prints at your location is to my number is a factor of 32 dozen of its digits is odd?

16


What is the 1000th odd number?

1 is the 1st odd number 3 is the 2nd odd number 5 is the 3rd odd number and so on 7 is the 4th odd number and so on if x is the 1000th odd number then x=2*1000-1=1999


What is 6 to the 1000th power?

6 to the 1000th power is an extremely large number. The value can be calculated by multiplying 6 by itself 1000 times, resulting in a number with 1502 digits. This number is so large that it is difficult to comprehend or visualize without the use of advanced mathematical tools.


Draw a flowchart to print prime numbers from 1 to 100?

The flowchart above starts with the number 2 and checks each number 3, 4, 5, and so forth. Each time it finds a prime it prints the number and increments a counter. When the counter hits 100, it stops the process. To determine whether a number is prime, it calls the function "IsThisNumberPrime" which is shown at the top of this page.


What number does the prefix milli represent?

It means "a thousandth of" - for instance, a millimetre is 1000th of a metre.


What is the 1000th digit in pi?

The 1000th digit of pi is...9


What is the phone number of the Ambers Originals And Prints in Chesterfield Virginia?

The phone number of the Ambers Originals And Prints is: 804-739-7466.


How do you spell 1000th?

The ordinal 1000th is "one thousandth" or simply "thousandth."


How will you know you have your 1000th customer in style savvy?

Renee normally tells you when it gets to a number like that


What is the 1000th triangular number?

Oh, dude, the 1000th triangular number is technically 500500. It's calculated by multiplying 1000 by 1001 and then dividing by 2. But hey, who's really keeping track of all these numbers anyway, right? Like, just enjoy the fact that it's a big ol' number with a fancy name.