Skip to content

Added Prime Number in Perl#1835

Merged
jrg94 merged 11 commits intoTheRenegadeCoder:masterfrom
msj2:patch-7
Nov 5, 2019
Merged

Added Prime Number in Perl#1835
jrg94 merged 11 commits intoTheRenegadeCoder:masterfrom
msj2:patch-7

Conversation

@msj2
Copy link
Contributor

@msj2 msj2 commented Oct 31, 2019

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

  • I named the pull request using Added/Updated <Sample Program> in <Language> format
  • I created/updated the language README
    • I added the sample program name to the README
    • I added fun facts (i.e. debut, developer, typing, etc.)
    • I added reference link(s) to the README
    • I added solution citations when necessary (see plagiarism)

Documentation

  • I named the pull request using Added/Updated <Sample Program> in <Language> Article format
  • I followed the applicable article template

Testing

  • I named the pull request using Added/Updated <Language>/<Project> Testing format
  • I followed the testinfo template, if applicable

Notes

Feel free to describe what you added or updated.

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 jrg94 requested a review from a team October 31, 2019 17:35
@jrg94 jrg94 self-assigned this Oct 31, 2019
@jrg94 jrg94 added enhancement Any code that improves the repo hacktoberfest Hacktoberfest related prime number See: https://sampleprograms.io/projects/prime-number/ labels Oct 31, 2019
@jrg94 jrg94 added this to the 500 Code Snippets milestone Oct 31, 2019
Copy link
Member

@jrg94 jrg94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure you add a reference to this in the README.

@jrg94 jrg94 changed the title Added Prime Number Checking Program in Perl Added Prime Number in Perl Nov 1, 2019
Copy link
Member

@jrg94 jrg94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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! 📦

msj2 added 9 commits November 4, 2019 16:53
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
Copy link
Member

@jrg94 jrg94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@jrg94 jrg94 merged commit d9d89a3 into TheRenegadeCoder:master Nov 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Any code that improves the repo hacktoberfest Hacktoberfest related prime number See: https://sampleprograms.io/projects/prime-number/

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Add Prime Number in Perl

2 participants