Added Prime Number in Perl#1835
Merged
jrg94 merged 11 commits intoTheRenegadeCoder:masterfrom Nov 5, 2019
Merged
Conversation
Accept a number on command line and print if it is Prime or Composite Prime Numbers will always be Odd and have only 1 Divisor, itself.. Use that to determine Composite. If
jrg94
requested changes
Nov 1, 2019
Member
jrg94
left a comment
There was a problem hiding this comment.
Make sure you add a reference to this in the README.
jrg94
requested changes
Nov 2, 2019
Member
jrg94
left a comment
There was a problem hiding this comment.
Spotted an error in the printed string. Otherwise, it looks like prime and composite might be reversed (at least based on testing). Looks good otherwise! 📦
Updated message, when number is less than 0
Fix empty input, negative number, quotes and decimal
0 must be composite number
1 is also a composite number
0 and 1 are Prime, Error out for Decimals
0 and 1 are Composite numbers, 2 is a Prime Number
Check for Integer first
Feeling bad, mistakes & mistakes, but I'll get from a Renegade to Supergrade Coder.
2 is a Prime Number check place it above Even number Check
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Accept a number on command line and print if it is Prime or Composite
Prime Numbers will always be Odd and have only 1 Divisor, itself.. Use that to determine Composite.
If
Congrats on taking the first step to contributing to the Sample Programs repository maintained by The Renegade Coder! For simplicity, please make sure that your pull request includes one and only one contribution.
Complete the Applicable Sections Below
Find which section best describes your pull request and make sure you fill it out. To start, let us know which issue you've fixed.
Code Snippets
Added/Updated <Sample Program> in <Language>formatDocumentation
Added/Updated <Sample Program> in <Language> ArticleformatTesting
Added/Updated <Language>/<Project> TestingformatNotes
Feel free to describe what you added or updated.