CS21 Homework 1
Due Thursday, September 4 by 11:30pm


  1. Go through the emacs tutorial. Being able to use the editor effectively will help you write your programs, find errors, and correct them more efficiently. At the unix prompt type emacs to enter the editor. Once in emacs, pull down the Help menu and choose the Tutorial option.
  2. After you have practiced using emacs, open a file called bio.txt and write a paragraph about why you are taking cs21. Also describe any programming experience you have had.
  3. Next create a file called add2.c and type in the program on page 26 of the textbook that reads in two numbers, adds them together and prints their sum. Compile the program by typing:
    gccx -o myadd add2.c
    
    If there are syntax errors, return to emacs and correct them.
  4. Once the program compiles successfully, an executable file will be created called myadd. Test the program by typing:
    ./myadd
    
    You may want to go back and modify your program in some way, for example to print different messages.
  5. Once you are satisfied with how the program works, hand in your program and your biography by typing:
    cs21handin
    
    and follow the directions. You may run cs21handin as many times as you like, but only the most recent submission will be recorded for each file you submit. This is useful if you realize after handing in a program that you need to make a few more changes to it.

    Important: You should hand in only your C source program file (the .c version), not the executable file.