CSCI 1120 (Low-Level Computing), Spring 2011:
Homework 1

Credit:
20 points.

Reading

Be sure you have read the assigned readings for classes through 2/14.

Programming Problems

Do the following programming problems. You will end up with at least one code file per problem. Submit your program source (and any other needed files) by sending mail to bmassing@cs.trinity.edu, with each file as an attachment. Please use a subject line that mentions the course number and the assignment (e.g., ``csci 1120 homework 1''). You can develop your programs on any system that provides the needed functionality, but I will test them on one of the department's Linux machines, so you should probably make sure they work in that environment before turning them in.

  1. (10 points) Write a C program that includes Sample output:
            100 seconds is 0 years, 0 days, 0 hours, 1 minutes, 40 seconds
            10000 seconds is 0 years, 0 days, 2 hours, 46 minutes, 40 seconds
            1000000 seconds is 0 years, 11 days, 13 hours, 46 minutes, 40 seconds
            100000000 seconds is 3 years, 62 days, 9 hours, 46 minutes, 40 seconds
    

    Hint: Probably the best way to do the required calculations is with integer-division (/) and remainder (%) operators.

  2. (10 points) Write a C program that includes Sample output:
            input 1 2 3
            in order 1 2 3
            input 3 2 1
            in order 1 2 3
    



Berna Massingill
2011-02-15