Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int num, divisor = 3;
- bool esPrimo( int num, int divisor );
- int main()
- {
- esPrimo(num)
- }
- bool esPrimo ( int num, int divisor ){
- if ( num != 2 and num % 2 == 0 ){
- return false;
- }
- else if ( divisor != num and divisor != 1 and num % divisor == 0 ){
- return false;
- }
- else esPrimo ( num, ++divisor );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement