Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

1.

a. ls
b. cd proj1
c. cp backup/p1.bak2 p1.c
d. diff p1.c p1.new.c
e. mv p1.joe.c my_p1.c

2.
a. F T F T T
b. if (ch >= 'A' && ch <= 'Z')
char name[16]; // need one more character for \0
c. printf("%%");
printf("%c", '%');
char ch = '%'; printf("%c", ch);
int k = %; printf("%c", k);
d. if (abc > 0 && abc%2 == 0)
e. No.
b/a*f is not the same as f*b/a. The latter will do both * and / as
float operations, but the fomer will treat b/a as an integer operation.
For example, if a=3, b=2, f=5.0,
b/a*f --> 0*5.0 = 0.0
f*b/a --> 10.0/3 = 3.33
f. b=2.80, a=3, b=3.00, c=2.00
g. Proj2
int main(int argc, char *argv[])
FILE *input;
input = fopen(argv[1], "r");
if (input != NULL)
fscanf(input, "%d", &a);

3.
a. a <= 10 --> a < 10 // or a=0 --> a=1
b. move \n inside the ""
c. %a %b --> %d %d
d. remove the & in front of answer
e. "A" --> 'A'

You might also like