Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
|
A simple program to check if the given number is Prime or not. More...
#include <cassert>
#include <iostream>
Namespaces | |
namespace | math |
for IO operations | |
Functions | |
bool | math::is_prime (int64_t num) |
Function to check if the given number is prime or not. | |
static void | tests () |
Self-test implementations. | |
int | main () |
Main function. | |
A simple program to check if the given number is Prime or not.
A prime number is any number that can be divided only by itself and 1. It must be positive and a whole number, therefore any prime number is part of the set of natural numbers. The majority of prime numbers are even numbers, with the exception of 2. This algorithm finds prime numbers using this information. additional ways to solve the prime check problem: https://cp-algorithms.com/algebra/primality_tests.html#practice-problems
int main | ( | void | ) |
|
static |
Self-test implementations.