|Check whether a number is prime....|General Coding Problems

fn is_prime(n: u32) -> bool

Easy

Check whether a number is prime.

fn is_prime(n: u32) -> bool

Asked in

cognizant

Examples

Example 1:
Input: 7
Output: true
Example 2:
Input: 10
Output: false
Submit Result

Click Run to test sample cases, or Submit to evaluate all cases