Question
In TSQL determine if a given number is a prime number. If youre not familiar with what prime numbers are, a refresher can be found
In TSQL determine if a given number is a prime number. If youre not familiar with what prime numbers are, a refresher can be found at:
https://www.khanacademy.org/math/pre-algebra/pre-algebra-factors-multiples/pre-algebra-prime-numbers/v/prime-numbers
A list of prime numbers can be found at:
http://www.primos.mat.br/indexen.html
For this assignment, you will declare a single variable and set it to the number you want to check. Your output should look like the following:
The number <#your number here> is/is not prime.
Make sure you understand the rules (for example 1 is not prime, but 2 is). Do not hard code the list of prime numbers. Your algorithm does not need to be super-efficient. I will check numbers up to around 5k.
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