Lab 02
Version 1

 

  1. Type in the Hello World program, compile it, and run it.

  2. Write a program that prints:
    Hello World!
    So long!
    I must be going! 
    
    Do not use any escape codes.

  3. Rewrite the program you just wrote so that it has only one statement inside main.

    (Recall that this is not really recommended programming style at this level, but is useful to know how to do later on in your career.)

  4. Write a program that prints the text:
    \\ is for backslash! 
    

  5. Write a program that prints:
    1 / 3 = 0.3333333333333333 
    
    where the last number is the result of doing the appropriate computation, rather than a string or numeric literal appearing in the program.

Last modified August 28 for Fall 99 cs5 by fleck@cs.hmc.edu


This page copyright ©1998 by Joshua S. Hodas. It was built with Frontier on a Macintosh . Last rebuilt on Sat, Sep 5, 1998 at 1:02:20 PM.
http://www.cs.hmc.edu/~hodas/courses/cs5/week_02/lab.html