Prime number, also known as prime number, has an infinite number. A natural number greater than 1, except 1 and itself, cannot be divided by other natural numbers (prime numbers), in other words the number is no longer a factor other than 1 and itself; otherwise called composite.
According to the basic theorem of arithmetic, each integer greater than 1 is either a prime number or a product of a series of prime numbers, and the written form is unique if the order of the primes is not considered in the product. The smallest prime number is 2.
So far, people have not found a formula to find all prime numbers.
The C language code is as follows:
# include <stdio.h>int main () //Main function { int i,j; //defines two cyclic variables printf ("The prime number between 100-200 is:"); for (i=100; i<=200; i + +) //outer for Loop { for (j=2; j<=i-1; j++) //Inner Loop { if (i%j == 0) //if can be 1 and it itself outsideThe number of integers is composite { break; } if (j == i-1) //if not divisible, it is prime { printf ("%d\t", I); //the cursor with a 8-character base for jumping output } } }return 0;}
Dry Tip: The division of integers will perform "rounding", and any fractional portion of the result will be discarded.
This article is from the "Nobody" blog, please be sure to keep this source http://814193594.blog.51cto.com/10729329/1696717
The number of prime numbers between C languages printing 100-200