Homework 02: Week 1
Name: _____________________________________________ Alpha: ___________________
Describe help received: ________________________________________________________
- Due before class on Friday, January 13
- This is a written homework - be sure to turn in a hard-copy of your completed assignment before the deadline.
Assignment
-
Section 1: "Starting out"
and
Section 2: "Variables"
from the Unit 2 class notes.
How carefully did you complete the reading? (Circle one)
Not at allSkimmed itRead someRead all
Required reading:
-
Consider the following command:
For each of the following, indicate whether it is a plain-text file, an executable, or neither after executing the command above.gcc fun.c -o program
-
gcc
: ________________________ -
fun.c
: ________________________ -
fun
: ________________________ -
program
: ________________________
-
-
The following program does not compile. Identify the problem(s) and annotate the
code to show how to fix it.
/* This is my awesome program. */ int main() { fputs("Three"); fputs("Two"); fputs("One"); fputs("Blastoff!"); return 0; }
- Even after fixing it so that the program compiles, it probably doesn't do
exactly what the programmer intended. What else do you think the programmer forgot
to do?
___________________________________________________________________