Site icon Learn C++

Quickly Learn To Count Prime Numbers In GNU C++ On Windows

GNU C/C++ Compiler (gcc , g++)

GNU GCC is another powerful C/C++ compiler originally written as the compiler for the Unix, Linux and GNU operating system. The GNU system was developed to be 100% free software, and it is efficient with both 32-bit and 64-bit operations. This compiler can be used on Windows using MinGW or CygWin Linux Simulators. Compiled executable files need a small dll to run independently on Windows. It is mostly compatible with CLANG standards. GCC Compiler can be used by Visual Studio Code, Dev C++, Code Blocks, and can be directly used with Command Prompt or PowerShell. It is available on the official product page https://gcc.gnu.org/.

This is a C++ Builder example to find number of prime numbers in a given range. In this example we are measuring calculation time of count_primes() function in five times.

[crayon-660605a1eec10823168046/]

We compiled and run this code on Windows by using MinGW linux simulator. Here are the results on run time.

Exit mobile version