answersLogoWhite

0


Best Answer

To keep it simple:

Write a main loop that goes through all the numbers, starting with 2, and incrementing one at a time. Determine whether each number is a Prime number. If it is, increment a counter.

To determine whether each number is a prime number, either use an inner loop, or a separate function. Test divisibility of the number "n" by every number from 2 to n-1. If you find a factor, then it is not a prime number.

Note that you can test divisibility by using the "%" operator. For example:

if (number % factor == 0)

// number is divisible by factor

else

// it isn't

User Avatar

Wiki User

10y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you find the 12th prime number using c?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How can find prime number by using if in vbscript?

Dim prime, nprime = TRUEn=cint(inputbox("Enter a number to find whether it is Prime or Not"))for i=2 to (n-1)If n mod i = 0 thenprime = FalseExit forEnd ifNextIf prime thenmsgbox "Yes! It is a Prime number"Elsemsgbox "No! it is not a prime number"End if


How do you find the prime number of 6 using a tree diagram?

6 2,3


How do you find a fraction of a prime number?

Divide the prime number.


How do you find the least prime number?

2 is the least prime number.


Write each number as the product of prime using exponents 405?

I assume you mean to find the prime factorization of 405. If so: 34 x 5


Find the prime number next to 23456787565?

The previous prime number is 23,456,787,559 and the next prime number is 23,456,787,593.


Can you find your 12th class compartment roll number?

yes


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.


What is the prime numbers for 374?

To find the prime factors of any number then divide the number by prime numbers of increasing value. When a prime number wholly divides the original number repeat the process with the same prime number but each time with the new quotient until complete division does not occur. Repeat with a prime number of higher value until the final quotient is 1. Using this process gives the prime factors of 374 as 2, 11 and 17.


What is a prime number and how do to find them?

13 is a prime number because u cant find 13 as a product on a multiplication!


How do you solve a prime number?

to answer a prime number you must find a number that goes into it and that divides by itself :)


What is prime factorizasion?

Prime factorization is when you find all the prime factors of a number.