Skip to content
Snippets Groups Projects
Select Git revision
  • e02c63ecd513a85b471daf99237cf69f4993566d
  • master default protected
  • v_230512
3 results

check_prime.cc

Blame
  • check_prime.cc 351 B
    #include <iostream>
    
    auto is_prime(unsigned int n) -> bool
    {
        // recipe to tell if n is a prime or not
        return false;
    }
    
    auto main() -> int
    {
        std::cout << "Number to check: ";
        unsigned int inp{};
        std::cin >> inp;
        if (is_prime(n))
            std::cout << "Yes, that's a prime.\n";
        else
            std::cout << "Not a prime.\n";
    }