CS 2213/1, Spring 2005      
Quiz 0 Questions
Last Name:                            First Name:                  

Don't spend too much time on any one question.

  1. Unix Basics: Suppose you are logged on to Linux/Unix and are in your home directory.

    1. Give a command to create a new directory rec2.

       

    2. Give a command to change to this new directory.

       

    3. Now assume that you have used vi to create a file which is a C program hello.c in this directory (as is partly described in the next question). Give a command to compile this C program, resulting in an executable file hello.

       

    4. Give a command to execute the filehello, and to redirect the output to a file named hello.output.

       

  2. vi Editor: Suppose you are using vi to create and edit a new file named hello.c.

    1. Give command(s) so that you can create and start editing the file.

       

    2. Give command(s) to enter the following line into the file:
        
        #include <stdio.h>
            

       

    3. Give command(s) to save the file and exit vi.

       

  3. lint:

    1. How will lint help us with the following segment of C code:

        
        double x = 3.1415926;
        printf("x = %10.6i\n", x);
            

       

  4. dice program:

    1. How does one write the formal parameter to a function in C when it is a 1-dimensional array named a?

       

    2. What is likely to be an error in the C constant definition:

        
        #define PI 3.14159265358979;
            

       


Copyright © 2011, Neal R. Wagner. Permission is granted to access, download, share, and distribute, as long as this notice remains.