1. |
Profilers are
A.
Tools that analyze the run time behaviour of a program
B.
Tools that check a C code for cross file consistency
C.
Tools that keep track of evolving versions of a file
D.
None of the above
Answer: A Explanation: |
2. |
Which of the following tools can be used to keep track of evolving versions of a file
A.
make
B.
yacc
C.
sccs
D.
dv
Answer: C Explanation: sccs stands for Source Code Control System. Many applications need periodical updation of files (e.g., master file in a business application). It is always better to have backup of the changed version. for security reasons and undo operations. SCCS is a UNIX tool that can be used to keep history of the changes made |
3. |
m4
A.
is a macro processor
B.
can he used to preprocess C code
C.
can be used to preprocess assembly language program
D.
none of the above Answer: A Explanation: cpp is 'C' preprocessor, m4 is a general purpose macro processor that can he used to pre-process C. as well as assembly language programs. Unlike cpp, it can do integer arithmetic. some string and substring manipulation, in addition to tile inclusion and conditional macro expanion which can be done by cpp also |
4. |
The first thing that is searched when a command references a file is it
A.
i-node
B.
i-node number
C.
permission setting
D.
none of the above Answer: B Explanation: Suppose you enter a command like cp x y. Unlike the user, who uses the name to identify and differentiate files, the system uses i-node number to uniquely identify a file. Any file name has an associated i-node number. In UNIX. different files can have the same name. But the associated i-nodc number will be different. The filename---i-node correspondence can be found in the directory which has to be the first one that is to be searched, as nothing can be done to a file without knowing its i-node number. |
5. |
cc command sequentially invokes
A.
preprocessor. compiler and link editor
B.
compiler and link editor
C.
preprocessor, compiler. assembler and link editor
D.
compiler, assembler and link editor Answer: C Explanation: |
6. |
Among the directory entries, i-node and the file contents. which will be changed when a file is updated?
A.
Only directory entry and tile contents
B.
Only i-node and file contents
C.
All the three
D.
None of the above Answer: B Explanation: Directory entries have two fields. One for the file name and the other for the i-node number. The i-node has many fields for storing all the information about the file, except the file name and the actual content of the tile. The content of the file will be in a separate place. So. the details of any file will be spread over these three places. When a file is updated its name and i-node number will remain the same. Only the contents and some fields in the i-node (like file size, time of last access, etc.) need to be changed. Hence the answer |
7. |
The cc command
A.
Can take more than one argument
B.
Can act on files with . or . o extension
C.
Creates . o files by default when more than one argument with .,- extension is present
D.
If provided with more than one argument. immediately terminates it the first argument fails to compile successfully Answer: A Explanation: |
8. |
The mv command changes
A.
Only the directory entry
B.
Only the directory entry and i-node
C.
Only the i-node number
D.
None of the above Answer: A Explanation: The mv command, say. try x y is not going to change the tile content, the i-node number or other information in the i-node. Only the file name is going to change. The file name is present only in the directory. So. the answer is (a). |
9. |
If 7 terminals are currently logged on. then the command
A.
date followed by 7
B.
date followed by 8
C.
date followed by 1
D.
an error message Answer: A Explanation: |
10. |
Choose the correct answers if the command ls -l /dev/mt0 display's
A.
The 'b' indicates that it is a special file
B.
mt0 indicates that it is a tape drive
C.
The ' b' indicates that data transfer is done in blocks
D.
All of these Answer: D Explanation: For regular (ordinary) files the first character (i.e. b here), will be just a underscore. For directories d. for character special files ' ' and ' b' for a block read special file. The last column will have lp for line printer. hp for disk drives. tty for terminals etc. The 3 in 3 , denotes the major device number and - minor device number. That is. this system denotes tape drives by 3 and 0 to single out a particular tape drive from the many tape drives, the system may have. |
11. |
Choose the correct statements.
A.
id x .o is a valid command (assume x . o exists)
B.
cc x. s is a valid command (assume x . s exists)
C.
Both (a) and (b)
D.
None of these Answer: C Explanation: |
12. |
cat/dev/tty
A.
Throws garbage onto the terminal 1.
B.
Just echoes what you type. line by line
C.
Terminates if one types control at the beginning of a line
D.
Both (b) & (c) Answer: D Explanation: First, the i-node number corresponding to idevi tty (i.e. the terminal currently used) is procured. Then the i-node is accessed. From it, the system understands, it is a character special file. So, whatever you type, if followed by ' n ' will he echoed in the terminal. Typing control d, also lushes the buffer contents to t ty. But unlike 'control d is not transmitted. So. if you type ab ( Ad) cd ( Ad) first ab will be immediately transmitted, then cd will be transmitted. Whenever you press control d. then what you have typed between the previous control d (or from the start of the current line) to the current control d will be transmitted. So. if you type two control d consecutively or a single control d. at the beginning of a line then you are telling it to transmit. but nothing is there to be transmitted. So. the command gets terminated. |
13. |
The header files used in C programs arc usually found in
A.
/bin/include
B.
usr/bin/include
C.
/dev/ include
D.
iusr/include Answer: A Explanation: |
14. |
The command pwd displays /x/y. After executing the command chmod u -x. which of the following commands will not work? |
15. |
A C program should be compiled with -g option (like cc -g x . c) to use |
16. |
The difference between a pipe and a regular file is that
A.
Unlike a regular file, pipe is not a file.
B.
The data in a pipe is transient. unlike the contents of a regular file
C.
Pipes forbid random accessing. while regular files do allow this
D.
Both (b) and (c) Answer: D Explanation: |
17. |
Choose the correct statements.
A.
The default linking arrangement for cc is dynamic
B.
Dynamically linked programs save disk storage
C.
Dynamically linked programs enhances shareability of library routines
D.
All of these Answer: D Explanation: |
18. |
Context switch changes the process mode from
A.
user to kernel mode
B.
kernel to user mode
C.
kernel mode to the kernel process
D.
Both (a) and (b) Answer: D Explanation: |
19. |
File x .c has 5 lines of code. The command |
20. |
Which of the following comments about the signals system call are true?
A.
It takes up two arguments
B.
The first argument is an integer
C.
The second argument is a pointer to a function
D.
All of the above Answer: D Explanation: |
21. |
lint can analyze the named source code for
A.
inconsistent usage
B.
non portability
C.
suspicious constructs
D.
All of these Answer: D Explanation: |
22. |
Which of the following characteristics of the original process are preserved when, the exec system call is executed
A.
The current working directory
B.
The open files
C.
PID & PPID
D.
All of these Answer: D Explanation: |
23. |
Which of the following remarks about lex are true?
A.
It generates a C program
B.
It produces a C code that consumes more memory than a C program that can be written separately to accomplish the same task
C.
It produces a C' code that executes slower than a C program that can be%%ritten separately to accomplish the same task
D.
All of these Answer: D Explanation: The purpose of lex is to generate a 'C' function yylex, that will recognize any pattern that is given as input to lex, as a regular expression. Also, it can perform the specified action (like deleting, printing, changing to some other pattern, enciphering, etc.) when the specified pattern is matched. It does this by converting regular expression into a non deterministic finite state automata- then a finite state automata—then reduces the number of states in it. lex is a program generator, which means we can write our own code, which functions the same as the lex output. Since lex applies a general set of rules to achieve this, what it generates will not make efficient use of memory and is slower too. Yet it is a powerful tool.that simplifies the programmer's job. |
24. |
Which of the following programs are not interactive? |
25. |
lex can be used for
A.
Text processing
B.
Code enciphering
C.
Compiler construction
D.
All of these Answer: D Explanation: |
26. |
The read in the previous question is a
A.
Library function
B.
System call
C.
Shell command
D.
None of the above Answer: C Explanation: |
27. |
Choose the correct statements.
A.
Any process has an associated owner ID and group ID
B.
Effective ID defines who you are for the duration of a process
C.
Real ID defines who you are for the duration of a process
D.
Both (a) & (b) Answer: D Explanation: |
28. |
The command cc x.c && a.out
A.
is equivalent to cc x.c ; a . out
B.
means execute a . out only when x . c compiles successfully
C.
means execute a . out only if cc x .c retuns a value 0 to the system
D.
Both (b) & (c) Answer: D Explanation: cc x . c ; a . out - means execute the command cc x . c and then a . out. If x . c fails to compile successfully, then if there is any executable file a . out, it will he executed. So, execution of a . out, has nothing to do with the outcome of cc x . c. In the case of cc x.c && a . out , a . out will be executed only if x . c compiles successfully (i.e. re-turns 0 as the exit status). |
29. |
Which of the following shell commands displays the contents of each of the command line arguments one by one |
30. |
The state of signals are
A.
preserved across a fork call
B.
not preserved across an exec call
C.
preserved across an exec call
D.
Both (a) & (b) Answer: D Explanation: |
Total questions |
||
Score : [XX/XX] | ||
Total questions | : | [TQ] |
Total answered questions | : | [AQ] |
Total unanswered questions | : | [UQ] |