CSE 142 Quiz 1
June 22, 2000
Name:
SID:
Answer the following questions about the code given below:
int squid; int clam; double octopus; char mussel; double cuttlefish; squid = 42; clam = 13; octopus = cuttlefish + 2; clam = squid - 1; mussel = 'M'; octopus = 17.0; nautilus = 0; printf("%d\n",squid);
1) List each variable in the code and write whether or not it was declared:
squid, clam, octopus, mussel, cuttlefish, nautilus (not declared)
2) List the identifiers that are not also variables (if any):
printf
3) List the reserved words:
int, double, char
4) What are the final values of the variables of integer type?
squid == 42, clam == 41
5) What are the final values of the variables of floating point type?
octopus == 17.0, cuttlefish == garbage