Write a function to check if a number (17) is prime.
MediumProblem Statement
Write a function to check if a number (17) is prime.
Sample Input
17
Sample Output
17 is a prime number
Limits
Time: 2s · Memory: 256 MB
Code Editor
00:00
#include <stdio.h>
int isPrime(int num) {
// Your code here
}
int main() {
int num = 17;
if (isPrime(num)) {
printf("%d is a prime number\n", num);
} else {
printf("%d is not a prime number\n", num);
}
return 0;
}
Input
17
Expected Output
17 is a prime number