Question: in perl programming. Answer all 4 please. 1- One of the traditional exercises to show loops is finding prime numbers. Write a program that displays
1- One of the traditional exercises to show loops is finding prime numbers. Write a program that displays all the primes between 1 and 1,000. Show each prime as it is found. Also show how many primes you found at the end of the program. 2- Modify the prime number program you wrote earlier to search primes between 2 and 1000. List the primes in a column, stacked one on top of each other so the column of digits are correct, like ...You may turn in 1 & 2 as one exercise . _ 3 Prompt the user for a long string, followed by a shorter one. Use both index and rindex to locate the short string inside the longer one and compare the results. 4- Create an array that holds the numbers from 1 to 10. Create a slice of that list with a different name that holds all the odd numbers, and another slice of that sublist that holds all the primes. Write a program that displays the last slice, one element at a time. Display the size of all three lists
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
