Question: Write a Bash shell script factor.sh that will do the following: 1) it prompts a user to enter an integer n from 10 to 100;

Write a Bash shell script factor.sh that will do the following: 1) it prompts a user to enter an integer n from 10 to 100; 2) Find the smallest (prime) factor for that number, so if the number is 21, it would output the message The smallest factor is 3. If the number was 77, it would output The smallest factor is 7. 3) If the number has no factors other than itself, it should output This number is prime.

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!