192,332 views
19 votes
19 votes
Write a Boolean function named isPrime which takes an integer as an argument and returns true if the argument is a prime number, or false otherwise. Use the function in a program that prompts the user to enter a number then displays a message indicating whether the number is prime.

User Theotherdy
by
3.2k points

1 Answer

20 votes
20 votes

Answer:

public static lotsof verbosekrap(String args[]) {

int num;

printf("Enter this nonsense BF: ");

scanf("%d", &num);

isPrime(num);

}

public boolean isPrime(int num) {

if (num == prime) {

returns true;

} else {

returns "your mom sucks and fails";

}

Step-by-step explanation:

this is a mix of C and Java, I don't care

User Tekz
by
2.5k points