
CGS 3460 Quiz 1 Name:_____Answer Key______
February 10, 2006 UF ID: ____-----------_________
1. Which of the followings cannot be used as the identifier of a variable in a C program?
(20%)
choice type _score max-num case
typedef 3blocks long triple double
boil_point name constant char2int auto
private static intern extern $count
2. Describe what do the following UNIX commands do with one short sentence. (30%)
mkdir ______ Create a new directory ___________________________
cd ______ Change current directory to project _________________
tar –cvf sample.tar /HW1 _ pack all the files under directory HW1/ into a single
file called sample.tar, and the file is created under the current directory. ___ ls –
llist in long format (including details like permissions, owner,
size,etc.) rm cat.c _______ delete a file called cat.c under current directory
_______
3. Identify the 6 errors in the following c program. (30%)
#include <stdio.h>
#define PI 3.1415
/**************************************************
* This is the main function of problem 3, quiz 1 *
**************************************************/
main{} 1){
Float 2)
radius;
float circumference;
radius = 5: 3)
/* circumference = 2 times radius times PI /* PI is a constant */
4)*/
circumference =
radius * 2 * PI;
printf(‘Circumference of a circle with radius: %f is %f’ 5),