Functions
Function-30
Function-31
Function-32
~/algor $ cat problems/funksiya-tub-sonlar-soni
Is it prime
Easy
1000 ms
128 MB
29%
Write a function IsPrime(x) that returns true if the positive integer $x$ is prime and false otherwise. A prime number is a number greater than $1$ that is divisible only by $1$ and itself.
Example 1: IsPrime(7) → true
Example 2: IsPrime(9) → false — $9$ is also divisible by $3$.
Write only the function body.
Input
One line with a positive integer $x$ — the argument of the function.
Output
The value returned by the function: true or false.
Note
$1 \le x \le 10^{6}$
Examples
Input #1
7
Output #1
true
Input #2
9
Output #2
false