Programming Exercises

Create a component that checks if a hardcoded number is a prime number and displays the result.

Hard

Problem Statement

Create a component that checks if a hardcoded number is a prime number and displays the result.

Sample Input

29

Sample Output

Is Prime: true

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
import React from "react"; const PrimeCheck = () => { return ( <div> {/* Display whether the number is prime */} </div> ); }; export default PrimeCheck;
Log in or sign up to run or submit your code.Log inSign up
Input
29
Expected Output
Is Prime: true