Homework 1
cs550 Operating Systems
5 points
Due Sept. 5, 2014 at the beginning of class
1. Write a program that will print out any size equilateral triangle using fgets and sscanf to read in the height in number of lines. The size must be greater than three.
2. Write a program that will print out the number of words in a string. Read in the string using fgets and write a function to perform the word count. You may assume that the words are delimited only by spaces. You may not use the strtok function.
3. Write a program that will print out the minimum value in a given double array. Assume the array is provided as text input (using stdin) and use a function to find the minimum. You must pass the array into this function as a parameter. You may assume a maximum of 20 elements in the array.
4. Write a program that uses a function to find and return the value of the first non-whitespace character in a string. A non-whitespace character is one that is not a tab, space, newline, or return character ('\t', ' ', '\n', or '\r').
5. Write a program that uses pointers to reverse the values contained within an array. You may assume the array is of type integer and is of size 10. You must use a loop to complete this problem and the loop iterator must be of type int *.