codinasion-archive / codinasion-programme

An open source codebase for sharing programming solutions.
https://codinasion.vercel.app/programme
MIT License
62 stars 147 forks source link

random-prime-number.c on Pull #1250 solves issue #1117 #1254

Closed SpirosArk closed 2 years ago

SpirosArk commented 2 years ago

random-prime-number.c on Pull #1250 solves issue #1117 issue #1127 must reopen

Originally posted by @SpirosArk in https://github.com/codinasion/codinasion-programme/issues/1252#issuecomment-1192858808

codinasion-bot[bot] commented 2 years ago

👋🏻 Hey @SpirosArk

💖 Thanks for opening this issue 💖

A Codinasion team member should be by to give feedback soon.

harshraj8843 commented 2 years ago

Just some clarification 🤔


random-prime-number.c on Pull https://github.com/codinasion/codinasion-programme/pull/1250 solves issue https://github.com/codinasion/codinasion-programme/issues/1117

1250 contains code for count-capital-letters, random-number, random-prime-number

But #1117 is for random odd number

How #1250 closes #1117

SpirosArk commented 2 years ago

random-prime-number does not check about whether the found number is divided by any other number.

So the output is always an odd number that does not checked whether it is prime or not.

All prime numbers are odd, but not all odd numbers are prime. We miss the check on random-prime-number.

Greenboat24 commented 2 years ago

All prime numbers are odd, but not all odd numbers are prime.

2 is prime.

SpirosArk commented 2 years ago

Yeah, was referring to the logic that random-prime-number.c is executing.

harshraj8843 commented 2 years ago

Maybe done, please check 👍🏻

codinasion-bot[bot] commented 2 years ago

This issue has been closed !!!

📆 Total duration: 0 days