Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool is_prime(uint64_t n)
- {
- for (uint64_t x = 2; x < n; x++ )
- {
- if (n % x == 0 )
- return false;
- }
- return true;
- }
- uint64_t my_prime(uint64_t prime)
- {
- uint64_t very_long_number = prime;
- uint64_t highest_found_prime = 0;
- for (uint64_t x = 2; x < very_long_number; x++)
- {
- if (is_prime(x) && x > highest_found_prime)
- {
- highest_found_prime = x;
- }
- }
- return highest_found_prime;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement