|
CMSC 104
Highly Recommended Sample Program
|
The Objective
To give you practice going through the steps of creating,
compiling, running and submitting a project.
The Task
Traditionally, every C programmer writes this program as their very
first. It is a simple program that displays the text
"Hello World" on the screen. We will continue that tradition and
give you practice before the real projects are assigned.
- Using your text editor, create a file named hello.c that looks just
like this one, except that your should replace all the stuff between
the < and > symbols with real information.
For example, replace
<your name here> with your name.
- compile your file with the Unix command
cc hello.c
If you are as bad a typist as most programmers, you
will get some compiler errors. Use your text editor to re-edit your file
to fix the errors, then recompile. If you typed well, the compiler did
not complain. You may find it interesting to go back and intentionally
mistype some characters to get a feel for the kinds of errors
the compiler can generate.
- run your program by typing a.out at the Unix prompt
Although this sample project carries no points and does not count toward
your grade, you will find that having done this project will make your real
projects go faster.