Requirement: Calculate the first 100 prime numbers
#include <stdio. h> </P> <p> void main () <br/>{< br/> int I; <br/> int x = 2; // natural number <br/> int sum = 0; // Number of prime numbers <br/> while (sum <100) <br/> {<br/> for (I = 2; I <X; I ++) // if this number can be divisible by 2 to the X-1, this number is not a prime number <br/>{< br/> If (X % I = 0) // if it can be deprecated, there is no need to continue the calculation. <br/>{< br/> B Reak; // so you can jump out. <br/>}< br/> If (x = I) // when can X be equal to I? <Br/>{< br/> sum ++; // a prime number is obtained each time, add <br/> printf ("% d/T", x) to the counter. <br/> If (sum % 10 = 0) // each 10 prime numbers is divided into one row for easy observation <br/>{< br/> printf ("/N "); <br/>}< br/> X ++; // do not forget this, natural Numbers increase naturally <br/>}