Question: write an algoritm to determine whether an integer is prime of composite. The algorithm should return a 0 if the in - teger is prime,

write an algoritm to determine whether an integer is prime of composite. The algorithm should return a 0 if the in-teger is prime, a 1 if the integer is composite and a 2 if the integer is neither prime nor composite and a 3 if the integer is less than 1. you may assume that the algorithm numberOfDivisors, defined in exercise 4, is available

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!