Exam Questions with Guaranteed
Pass Solutions.
MacOS is a version of Unix. - Answer True
UNIX allows only one user to use the computer system at a time. - Answer False, many users
can use the system at once
You can use char as an identifier. - Answer False, char is a keyword
Commands v = 17; and v = 017; and v = 0x17; all set v to the same value. - Answer False, first
one is a decimal value, second, third is a hexadecimal
Variable names in C are case-sensitive. - Answer True
Your textbook says that Linux does not connect to the Unix "family tree" because it is a
complete reimplementation and shares no common code with any Unix version. - Answer True
In a format specifier for a printf statement, what does %x mean? - Answer Hexadecimal
Which of the following is the Unix philosophy? - Answer A program should do one thing, and
do it well
Why is it that computers running Unix do not have graphical user interfaces? - Answer This is
false, Unix computers do have graphical user interfaces.
Which tool is responsible for converting C source code into an object file? - Answer Compiler
Which of the following files is generated after a successful linking step? - Answer Executable
file
What does a return value of 1 from the scanf function indicate? - Answer The input was
, To pass a file of integers to a program, which command should you use for more efficiency? -
Answer ./scanf_ex3 < file.txt
Why does checking the return value of scanf before printing a prompt not work with pipes or
input redirection? - Answer Because scanf can't detect if input is from a pipe.
How would you generate random integers between 0 and 3
using the rand() function? - Answer rand() % 4
What is the expected distribution of random numbers generated by the function rand() % 47 -
Answer All values are equally likely.
In class, we saw the following. What is the reason?
$ ssh
ssh: connect to host snowball.cs.gu.edu
port 22: Network is down - Answer The wifi was not working.
"kill" is example of what? - Answer Sending a signal
What does gcc -S example.c do? - Answer Creates an assembly language listing.
Suppose that we have the following code:
if (m==1)
;
printf("ending\n");
Under what conditon does the code print "ending"? - Answer Regardless of the value of m.
If you declare an array such as int myarray[10];. Which statement is true? - Answer The array
values might not be zero.