Explore topic-wise MCQs in Technical Programming.

This section includes 746 Mcqs, each offering curated multiple-choice questions to sharpen your Technical Programming knowledge and support exam preparation. Choose a topic below to get started.

451.

In awk, the built-in variable FS is

A. input field seperator
B. output field seperator
C. record seperator
D. subscript seperator
Answer» B. output field seperator
452.

The built-in function tolower()

A. converts all lowercase characters into uppercase characters
B. returns the string with all lowercase characters
C. changes the nonalphabetic characters
D. none of the mentioned
Answer» C. changes the nonalphabetic characters
453.

Which built-in function divides string into pieces seperated by fieldsep and stores the pieces in array?

A. split()
B. divide()
C. index()
D. sub()
Answer» B. divide()
454.

Which built-in function returns the arctangent of a/b in radians.

A. atan2(a/b)
B. atan(a/b)
C. atan_2(a/b)
D. none of the mentioned
Answer» B. atan(a/b)
455.

What is the difference between the built-in functions rand() and srand() in awk programming?

A. rand() generates the random number but srand() does not generate the random number
B. rand() generates the same random number always whenever the program runs but srand() generates the different
C. srand() requires the seed() function but rand() does not require to produce the same result
D. none of the mentioned
Answer» C. srand() requires the seed() function but rand() does not require to produce the same result
456.

Which statement instructs gawk to stop processing the current data file?

A. next
B. nextfile
C. exit
D. exitfile
Answer» C. exit
457.

If the argument is supplied to the exit statement,

A. its value is used as the exit status code for the awk process
B. syntax error will generate
C. exit returns status 0
D. exit returns status 1
Answer» B. syntax error will generate
458.

The next statement

A. immediately stops processing the current record
B. go to the next record
C. immediately stops processing the current record & go to the next record
D. none of the mentioned
Answer» D. none of the mentioned
459.

Which statement skips over the rest of the loop body, causing the next cycle around the loop to begin immediately?

A. continue
B. break
C. next
D. none of the mentioned
Answer» B. break
460.

The break statement

A. jumps out of the innermost for loop
B. jumps out of the innermost while loop
C. jumps out of the innermost do-while loop
D. all of the mentioned
Answer» E.
461.

The comparison expression “x ~ y” will true if

A. x is not equal to y
B. the string x does not match the regular expression denoted by y
C. the string x matches the regular expression denoted by y
D. none of the mentioned
Answer» D. none of the mentioned
462.

Concatenation is performed by

A. writing expressions next to one another, with no operator
B. conditional operator
C. relational operator
D. matching operator
Answer» B. conditional operator
463.

All numeric values are represented within awk in

A. double precision floating point
B. integer
C. exponential notation
D. fixed point
Answer» B. integer
464.

What is expression in awk programming?

A. expression evaluates a value to print, test or pass to a function
B. expression assigns a new value to a variable or field
C. expression evaluates a value to print, test or pass to a function & also assigns a new value to a variable or field
D. none of the mentioned
Answer» D. none of the mentioned
465.

Which one of the following statement is not true about the format-control letters for printf statement in awk program?

A. “c” prints a number as an ASCII character
B. “d” prints a decimal integer
C. “h” prints an unsigned hexadecimal integer
D. “o” prints an unsigned octal integer
Answer» D. “o” prints an unsigned octal integer
466.

What is the output of the command awk ‘BEGIN {printf “%c\n”,65}’

A. A
B. 65
C. syntax error
D. none of the mentioned
Answer» B. 65
467.

The command “awk {print $1} san.txt” will

A. The command “awk {print $1} san.txt” will
B. print the first field of every line in san.txt
C. generate syntax error
D. none of the mentioned
Answer» C. generate syntax error
468.

The print and printf statements can be told to send their output to other place except standard output, is called

A. redirection
B. redistribution
C. reinsertion
D. none of the mentioned
Answer» B. redistribution
469.

In awk program, the statement “print” with no items

A. is equivalent to “print $0”
B. prints the entire current record
C. is equivalent to “print $0” & prints the entire current record
D. none of the mentioned
Answer» D. none of the mentioned
470.

What is the meaning of $ sign in awk programming?

A. the word following is the name of variable
B. we are refering to a field or column in the current line
C. $ sign is used for comment
D. none of the mentioned
Answer» C. $ sign is used for comment
471.

An awk program can be run by

A. including the program in the command that runs awk
B. putting it into a file and run with a command
C. running an executable awk script
D. all of the mentioned
Answer» E.
472.

Which option is used by sed to specify that the following string is an instruction or set of instructions?

A. -n
B. -e
C. -f
D. -i
Answer» B. -e
473.

Which command will delete all the blank lines in file old.txt?

A. sed ‘/d’ old.txt
B. sed ‘/^/d’ old.txt
C. sed ‘/^$/d’ old.txt
D. sed ‘/^*/d’ old.txt
Answer» D. sed ‘/^*/d’ old.txt
474.

Which command is used to replace word ‘cat’ (already present in the file) with ‘mouse’ at all places in a file ‘old.txt’ and save the result in a new file ‘new.txt’?

A. sed ‘s/cat/mouce/g’ old.txt > new.txt
B. sed ‘s/cat/mouse’ old.txt new.txt
C. sed ‘/s/cat/mouse/g’ old.txt new.txt
D. sed ‘/s/cat/mouse’ old.txt > new.txt
Answer» B. sed ‘s/cat/mouse’ old.txt new.txt
475.

Which sed command deletes the specified address range

A. [address range]/s
B. [address range]/p
C. [address range]/d
D. [address range]/y
Answer» D. [address range]/y
476.

If no file is specified in sed command then

A. sed command will not work
B. sed reads from standard input
C. sed reads the data already present in buffer
D. it is necessary to provide the filename
Answer» C. sed reads the data already present in buffer
477.

Which is the correct syntax for sed on command line?

A. sed [options] ‘[command]’ [filename].
B. sed ‘[command]’ [options] [filename].
C. sed [filename] [options] ‘[command]’
D. sed ‘[command]’ [filename] [options].
Answer» B. sed ‘[command]’ [options] [filename].
478.

Sed maintains the hold space (a buffer) to

A. copy the each line of input
B. save the data for later retrieval
C. copy the each line of input & save the data for later retrieva
D. none of the mentioned
Answer» C. copy the each line of input & save the data for later retrieva
479.

What is sed?

A. a non-interactive stream editor
B. an IDE
C. a hex editor
D. none of the mentioned
Answer» B. an IDE
480.

Which command sets the number for all lines?

A. :set li
B. :set ln
C. :set nu
D. :set nl
Answer» D. :set nl
481.

Which command shows all the abbreviations in vi editor?

A. ab
B. abb
C. show
D. none of the mentioned
Answer» B. abb
482.

In vi editor, which command reads the content of another file?

A. read
B. r
C. ex
D. none of the mentioned
Answer» D. none of the mentioned
483.

Which command searches the string in file opened in vi editor?

A. / or ?
B. f or F
C. t or T
D. none of the mentioned
Answer» B. f or F
484.

Which one of the following statement is true?

A. autoindentation is not possible in vi editor
B. autoindentation can be set using the command ‘:set ai’
C. autoindentation can be set using the command ‘:set noai’
D. autoindentation is set by default in vi editor
Answer» C. autoindentation can be set using the command ‘:set noai’
485.

Which command is used to delete the character before the cursor location in vi editor?

A. X
B. x
C. d
D. D
Answer» B. x
486.

Which vi editor command copies the current line of the file?

A. yy
B. yw
C. yc
D. none of the mentioned
Answer» B. yw
487.

In vi editor, the key combination CTRL+f

A. moves screen down one page
B. moves screen up one page
C. moves screen up one line
D. moves screen down one line
Answer» B. moves screen up one page
488.

Which command is used to close the vi editor?

A. q
B. wq
C. both q and wq
D. none of the mentioned
Answer» D. none of the mentioned
489.

Which one of the following statement is not true?

A. vim editor is the improved version of vi editor
B. vi editor commands are not case sensitive
C. vi editor has two modes of operation: command mode and insert mode
D. vi stands for visual editor
Answer» C. vi editor has two modes of operation: command mode and insert mode
490.

Which command executes ‘command’ in place of the current process instead of creating a new process?

A. exec
B. command
C. trap
D. none of the mentioned
Answer» B. command
491.

Which command generates possible completions for string according to the and write it to standard output?

A. compgen
B. complete
C. continue
D. none of the mentioned
Answer» B. complete
492.

Which option of the command ‘cd’ use the actual filesystem path for cd.. and the value of pwd?

A. -l
B. -L
C. -p
D. -P
Answer» E.
493.

Which command runs the shell built-in command ‘command’ with the given argument?

A. builtin
B. caller
C. there is no command present for this purpose
D. none of the mentioned
Answer» B. caller
494.

Which command prints the accumulated user and system times for processes run from the shell?

A. time
B. times
C. both time and times
D. none of the mentioned
Answer» C. both time and times
495.

Which command wait for the specified process to complete and return the exit status?

A. sleep
B. wait
C. delay
D. stop
Answer» C. delay
496.

Which command identifies the resource of a command?

A. type
B. typeset
C. select
D. source
Answer» B. typeset
497.

The command ‘ulimit’

A. set a limit on specified resource for system users
B. set/show process resource limit
C. set a limit on specified resource for system users & set/show process resource limit
D. none of the mentioned
Answer» D. none of the mentioned
498.

Which command puts a script to sleep untill a signal is recieved?

A. sleep
B. suspend
C. disown
D. break
Answer» C. disown
499.

Which command removes a directory from directory stack?

A. dirs
B. popd
C. pushd
D. rm
Answer» C. pushd
500.

Which option of the kill command sends the given signal name to the specified process?

A. -l
B. -n
C. -s
D. -a
Answer» D. -a