practice for programmers
Logged in as Anonymous Student
254271 Fundamentals Programming (Sec 1&2) - Arrays
A. Print it all in one line
Write a program that reads strings into an array. When the input ends, print all the strings on one line, separated by a space.
B. Reverse list
Write a program that reads in a list of strings (one per line) and prints them out in reverse order.
C. Reverse numbers
Write a program that reads in integers and prints them in reverse order.
D. Positive and negative numbers
Write a program that reads in a list of numbers and sorts them into 2 lists: positive and negative. Note: 0 is positive.
E. Less than last
Write a program that reads in a list of integers. Print out all the integers that are less than the last element of the list. Example, if the input is
3 8 5 7
then the last element is
, so print out
F. Number removal
Write a program that reads in a list of integers and then prints out the numbers 1 to 20 NOT including the numbers from the input.