Question
Using Raptor create a program that will input a positive integer from the user. The program should check to make sure the entry is a
Using Raptor create a program that will input a positive integer from the user. The program should check to make sure the entry is a positive integer and then check to see if the number is a prime number. A prime number is a number that is divisible only by itself and 1. The first five prime numbers are 2, 3, 5, 7, and 11; you can check this directly from the definition. If the number is prime, the program should display a message to this effect. If the number is not prime, the program should display the number and its factors. For example, if the user enters the number 3, the output should be: The number 3 is a prime number. However, if the user enters the number 6, the output should be: The number 6 is not a prime number. The factors of 6 are: 1, 2, 3, 6
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started