Explore topic-wise MCQs in Computer Science Engineering (CSE).

This section includes 713 Mcqs, each offering curated multiple-choice questions to sharpen your Computer Science Engineering (CSE) knowledge and support exam preparation. Choose a topic below to get started.

451.

Which of the following displays the exit status of the last executed command?

A. echo $4
B. echo $$
C. echo $?
D. echo $!
Answer» D. echo $!
452.

Which of the following programs are not interactive?

A. passwd
B. date
C. grep
D. both (b) & ©
Answer» B. date
453.

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» B. only the directory entry and i-node
454.

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» D. if provided with more than one argument. immediately terminates it the first argument fails to compile successfully
455.

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» D. compiler, assembler and link editor
456.

A C program should be compiled with -g option (like cc -g x . c) to use

A. proof
B. make
C. lprof
D. sdb
Answer» E.
457.

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 ©
Answer» E.
458.

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» E.
459.

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» E.
460.

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) & ©
Answer» E.
461.

Choose the correct answers if the command ls -l /dev/mt0 display's brw_rw_ _ _ _ 1 root 3, 0 Apr18 1:05 mt0

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» E.
462.

If 7 terminals are currently logged on. then the command date ; who | wc -l, displays

A. date followed by 7
B. date followed by 8
C. date followed by 1
D. an error message
Answer» B. date followed by 8
463.

The .(dot) shell command

A. can take command line argument
B. will fork a child shell to execute the named shell script
C. can be used to change the environment of the current shell
D. all of the above
Answer» D. all of the above
464.

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» D. none of the above
465.

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» D. dv
466.

The shell command :

A. does nothing
B. can be used to cause infinite looping
C. can take arguments but it cannot act on them
D. all of these
Answer» E.
467.

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» B. tools that check a c code for cross file consistency
468.

If one exports a variable

A. variables placed in the environment by a child process are not inherited by the parent process
B. it is passed to all its descendant processes
C. it dies when the shell that created it dies
D. all of these
Answer» E.
469.

Which of the following are character special files

A. terminal
B. printer
C. modem
D. all of these
Answer» E.
470.

Environment variables can be accessed by

A. system programs
B. c programs
C. shell scripts
D. all of these
Answer» E.
471.

lint should be used

A. before compilation
B. to analyze a c code
C. after compilation
D. both (a) and (b)
Answer» E.
472.

Which of the following metacharacters will be recognized by the shell. even if it comes within double quotes?

A. $
B. *
C. ?
D. none of these
Answer» B. *
473.

The system identifies a file by its

A. name
B. absolute path
C. both (a) and (b)
D. mode number
Answer» E.
474.

The command line argument a.out x 'a b' "c d"

A. is acceptable
B. is acceptable if the double quotes are replaced by single quotes
C. is acceptable if the single quotes arc replaced by double quotes
D. none of the above
Answer» B. is acceptable if the double quotes are replaced by single quotes
475.

The command who sort - file1 > file2

A. results in an error
B. sorts the contents of file1 and puts it in file2
C. both (a) and (b)
D. none of the above
Answer» E.
476.

Redirection in pipes can be achieved by using

A. >
B. >>
C. tee
D. lpr
Answer» D. lpr
477.

The system identifies the end of a file by the

A. eof character
B. file size
C. i-node number
D. both (a) and (b)
Answer» C. i-node number
478.

Which of the following are not filter programs?

A. date
B. sort
C. cat
D. grep
Answer» B. sort
479.

Choose the correct statements.

A. the symbols > and | are both processed by shell
B. > can be used to direct output to a named file
C. | can be used to direct output to programs
D. all of above
Answer» E.
480.

The main reasons for the success of pipes are

A. the availability of many filter programs
B. unix treats devices as files
C. it provides a 2- way communication channel
D. both (a) and (b)
Answer» E.
481.

/bin

A. is a bucket for storing information
B. has files in binary code
C. is a directory
D. both (b) and ©
Answer» E.
482.

Which of the following file names can be found in more than one directoy?

A. passwd
B. bin
C. date
D. both (a) and (b)
Answer» E.
483.

If cat x. prints garbage. then x is probably a

A. data file
B. binary file
C. text file
D. source file
Answer» C. text file
484.

Which of the following remarks about realloc are true?

A. it allocates memory of required size that need not be contiguous
B. it may shift the existing block
C. it can work only with an existing block of memory
D. both (b) and ©
Answer» E.
485.

To allow only one user to work with a particular file at a particular time, one has to use

A. semaphore
B. critical region
C. locking
D. dedicated mode
Answer» D. dedicated mode
486.

The differences between malloc( ) and calloc() are:

A. malloc is used for dynamic allocation of memory, while cal:1c can\t be used for that purpose
B. malloc needs only one argument. while cal loc needs two.
C. unlike malloc, calloc allocates memory and initializes it to 0.
D. both (b) and ©
Answer» E.
487.

Files that store data in the same format as used in program are called

A. binary files
B. source file
C. text file
D. core
Answer» B. source file
488.

Choose the incorrect statements.

A. shell scripts can accept arguments
B. shell scripts are interpreted
C. shell is a programming language
D. shell scripts are compiled
Answer» E.
489.

Shell script is preferable to other forms of programming because it

A. makes programming task easier
B. enhances portability
C. occupies less space
D. all of these
Answer» E.
490.

A file x is created with the following contents echo today is: date If you type x.then

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.
491.

Let x.c be a C source code. The command cc x.c > y

A. is equivalent to the command cc x.c;mv a.out y
B. is equivalent to the command cc -o y x.c
C. serves no purpose
D. none of the above
Answer» D. none of the above
492.

The default permission bits of a file when it is created for the first time, is controlled by

A. chmod value
B. fmask value
C. umask value
D. none of the above
Answer» D. none of the above
493.

Consider the program main ( ) { printf("He arose a victor from\n"); system ("date") ; printf("the dark domain"); } If a.out is the executable code corresponding to the above source code, then the command a.out > out f

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
494.

Which of the following string functions can be used to find the last occurrence of a given character in a given string?

A. strncmp
B. strncpy
C. strchr
D. none of the above
Answer» E.
495.

Consider the following command that invokes the executable file a.out, with the following command line arguments a .out God loves you argv( [1][2] )corresponds to the character

A. e
B. o
C. y
D. d
Answer» E.
496.

Writing a C program that accepts input from keyboard, rather than from a file is advantageous because

A. keyboard is a file that is already open
B. it can be used in a pipe, if it writes to stdout
C. both (a) and (b)
D. none of the above
Answer» D. none of the above
497.

If one doesn't want anyone else to read or write to a file named datfile, except through a program in a file filex , then he may use

A. chmod u+s filex ; chmod go_rw datfile
B. chmod 4711 filex ; chmod go_rw datfile
C. chmod 4711 datfile ; chmod go_rw filex
D. both (a) and (b)
Answer» E.
498.

/bin/passwd has the user execution permission set to 's' because

A. this facility assigns to the user, permissions of the program owner. temporarily
B. it should allow users who don\t have write permission to /etc/passwd to write to it
C. /etc/passwd is write protected
D. all of these
Answer» E.
499.

dev/null

A. is a file
B. has write permission for all
C. is the unix built- in dustbin
D. all of these
Answer» E.
500.

The permission bits of a file noname. can be set to _rws_ _x_ _x by the command.

A. chmod 711 noname
B. chmod go -rw noname
C. chmod 2711 noname
D. none of the above
Answer» E.