MCQOPTIONS
Saved Bookmarks
This section includes 16 Mcqs, each offering curated multiple-choice questions to sharpen your Operating System Architecture knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
What is stored in logfile as per below mentioned code if we execute ./a.out > logfile?nt main() { |
| A. | hello |
| B. | helloworld |
| C. | world |
| D. | none |
| Answer» C. world | |
| 2. |
Given a code snippet below? #define PERMS (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) |
| A. | rw-rw-rw- r——– |
| B. | r——– rw-rw-rw- |
| C. | rw-rw-rw- rw—— |
| D. | none of the abov |
| Answer» D. none of the abov | |
| 3. |
Code snippet (file1 size is 2024)f1 = fopen (file1, RDWR, RWX) |
| A. | 1024 |
| B. | 1034 |
| C. | 2034 |
| D. | 2054 |
| Answer» C. 2034 | |
| 4. |
For the below mentioned codeint main() { int fd; |
| A. | 5 |
| B. | 1024 |
| C. | 1029 |
| D. | 1034 |
| Answer» C. 1029 | |
| 5. |
The command echo welcome >/dev/tty |
| A. | echoes welcome in all the terminals that are switched on |
| B. | echoes welcome in all the " that are logged on |
| C. | echoes welcome only in the terminal in which it is run |
| D. | both (a) and ( c) |
| Answer» E. | |
| 6. |
Lint should be used |
| A. | before compilation |
| B. | after compilation |
| C. | to analyze a c code |
| D. | none of the above |
| Answer» B. after compilation | |
| 7. |
What is the output of the following program? x = 3; y = 5; z = 10; |
| A. | 1 |
| B. | 3 |
| C. | 5 |
| D. | error |
| Answer» C. 5 | |
| 8. |
What is the output of the following program? [ -n $HOME ] |
| A. | 0 1 |
| B. | 1 0 |
| C. | 0 0 |
| D. | 1 1 |
| Answer» B. 1 0 | |
| 9. |
What would be the current working directory at the end of the following command sequence? $ pwd |
| A. | /home/user1/proj |
| B. | /home/user1/proj/sr c |
| C. | /home/user1 |
| D. | /home/user1/proj/src/generic |
| Answer» E. | |
| 10. |
What is the output of the following program?b = |
| A. | 1 1 |
| B. | 2 2 |
| C. | 0 0 |
| D. | 0 1 |
| Answer» D. 0 1 | |
| 11. |
The following commands gives the output like this #cat file1 file2 |
| A. | cat: file1: no such file or directory hello |
| B. | no output is displayed |
| C. | cat: 1>2: no such file or directory |
| D. | hello |
| Answer» C. cat: 1>2: no such file or directory | |
| 12. |
Consider the program main ( ) |
| A. | redirects the output of date to file out f |
| B. | displays the output of date on the screen |
| C. | prints everything on the screen |
| D. | prints the two messages on the screen |
| Answer» B. displays the output of date on the screen | |
| 13. |
A file x is created with the following contents |
| A. | it echoes the message. followed by date. |
| B. | it gives the desired output only if the execute permission of file x is set. |
| C. | the desired output can be got by the command sh x. which works even if x has its execute permission not set. |
| D. | both (b) and © |
| Answer» E. | |
| 14. |
Consider the following program main ( ) |
| A. | redirects the output of date to a file out f |
| B. | displays the output of date on the screen |
| C. | prints everything on screen |
| D. | prints the two messages on the screen |
| Answer» B. displays the output of date on the screen | |
| 15. |
Below is the codeint main() { int fd1, fd2; |
| A. | 30 30 |
| B. | 100020 20 |
| C. | 100030 30 |
| D. | 100010 30 |
| Answer» E. | |
| 16. |
ode snippets str1=”45678\n” str2=”123\n” |
| A. | 12378 |
| B. | 123(newline)8(new line) |
| C. | 123(newline)78(ne wline) |
| D. | 45678(newline)1 23(newline) |
| Answer» C. 123(newline)78(ne wline) | |