| Midterm Exam | Name ____________________________________ |
CSC 7000-002 Algorithms & Programming
Fall 1999, Mendel 115
Dr. David Matuszek
if then else while do repeat until signed
top_job register _important_ id#5 $limit Default
i = 5; j = i++; |
|
i = 5; j = --i; |
|
i = 0; j = 10; |
|
int a[10]; |
|
i = rand() % 10 / 100; |
|
i = 15; |
|
char *p; |
|
i = 2; |
|
i = 10; j = 3; |
|
i = 1; j = 2; |
do...while loop controls only a single statement.a & b |
|
& b |
|
a && b |
|
a % b |
|
a += b |
|
a != b |
|
a >> b |
|
a . b |
|
a -> b |
void write_message (char *filename, char *message) {
/* Declare a FILE variable to use in this function */
/* Open the file for writing */
/* Write the message onto the file */
/* Close the file and return */
}
main actually has arguments, but most of our programs so far
have ignored those arguments. Write a prototype for main that shows what the
arguments actually are. \n,
followed by a newline. That is, it should print the three characters \, n,
and newline. a[100] to all zeros. person to hold a person's name, age, and phone
number. fscanf(), that can
you use to read in an entire line as a string? p is of type char*, what does the expression p
== "hello" actually test? string (for
example, string s,t;). Write the one statement that defines string
to mean the same thing as char*. Short answer: