From 33f9d092f22c7891c77f9d539236c3589a3c7085 Mon Sep 17 00:00:00 2001 From: DoctorLai Date: Fri, 3 Oct 2025 22:06:52 +0100 Subject: [PATCH 1/2] Show prime or composite) --- src/App.jsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index 25f55db..e5c7018 100755 --- a/src/App.jsx +++ b/src/App.jsx @@ -22,7 +22,15 @@ export default function App() { if (value && Number(value) > 0) { const factors = primeFactorization(value); - setResult(`${value} => ${factors}`); + if (value == factors) { + setResult( + `${value} => ${factors}

(${value} is a prime number)`, + ); + } else { + setResult( + `${value} => ${factors}

(${value} is a composite number)`, + ); + } } else { setResult("Please enter a positive integer."); } @@ -79,7 +87,7 @@ export default function App() { > coffee {" "} - ☕ + ☕16

Open Source on{" "} From f7cd4c5e00764f1aaaa80db4d1008876622f3c67 Mon Sep 17 00:00:00 2001 From: DoctorLai Date: Fri, 3 Oct 2025 22:08:00 +0100 Subject: [PATCH 2/2] Typo --- src/App.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/App.jsx b/src/App.jsx index e5c7018..c8fdc9a 100755 --- a/src/App.jsx +++ b/src/App.jsx @@ -87,7 +87,7 @@ export default function App() { > coffee {" "} - ☕16 + ☕

Open Source on{" "}