name:
mail
program.
mail
program without deleting those messages? If so, explain how.count
when the following
program finishes execution?
#include <stdio.h> main() { int count = 37; do { count++; if (count > 5) break; count = 3; } while (count <= 10); if (count > 8) count = 23; else count = 24; }
myfile
with vi.
Give the sequence of keystrokes needed to save changes and quit vi.
Indicate special keys by enclosing their
names in angle brackets (i.e. <Enter>
or <Esc>
).coolstuff
.
coolstuff
directory, but others can only read
and execute files in that directory.coolstuff
called frombob
, and then copy file
websites.txt
from user bob
's home directory to the
frombob
directory. (For 2 points extra credit, don't use the
cd
command anywhere in your sequence of commands.)
int i = 13; printf("%d", (i > 13)? i - 1: i + 1);
#include <stdio.h> int fun1(int x) { return (fun2(x) + 1); } int fun2(int x) { return (x - 3); } main() { int z; z = fun1(5); }
int i1 = 0, i2 = 1, i3 = 2; float f1 = 0.0, f2 = 4.0; double d1 = 5.0, d2 = 6.7;Give the result of evaluating each of the following expressions and the type of that result, or indicate that evaluating the expression would cause a run time error in a C program. If the result is a float or double, your answer only needs to show one place after the decimal point.
(int) d2 - i2 + f2
5.0 + f2 / i2 - f2
(float) d1 / f1
int i1 = 0, i2 = 1, i3 = 2; float f1 = 3.0, f2 = 4.0; double d1 = 5.0, d2 = 6.0;
(!(i2 > 7.0) || (i2 + f2 == d2))
((i2 + d2 / f1 == f2) && ((d1 / i1) == 7))
((f1 == 3) || ((d1 / i1) == 0))
a
by printing:
less than 50if
a
is less than 50,
between 50 and 60if
a
is between 50 and 60 inclusive, and
greater than 60if
a
is greater than 60.
if
statements.switch
statement? Why or why not?while
loop.
int i = 0, prod = 1; while (prod <= 125) { printf("The current value is %d\n", i); i++; prod *= 5; }
i
after the while
loop
executes?for
loop that produces the same output and
final value of prod
as this while
loop.#include <stdio.h> int x = 4; void inc(int); float foo(int *, double *); main() { int y = 3, z = 5; float f; double d = 7.0; inc(y); printf("The value of x is %d and y is %d\n", x, y); f = foo(&z, &d); printf("The value of f is %f and z is %d and d is %lf\n", f, z, d); } void inc(int x) { x++; } float foo(int *y, double *z) { *z = *z + 2; return ((float) *y + 3); }