1. Write a perl program which iterates over a list of numbers (e.g. create an array with some numbers), and only prints the number if it is an odd number (Hint, you will want to use the % modulus operator for this). Change it to only print out even numbers, adding only one new character to the program.
2. Write a perl program to print out the word 'testing' ten times using a while loop.
3. Write a program which iterates over a list of words, with some redundancy (create an array with 4-5 words, with at least one word repeated more than once), and prints the word if it has not been seen before. Change it to print the word if it has been seen before (you are not limited in how you change the program this time).
Comments (0)
You don't have permission to comment on this page.