Skip to main content

System Programming MCQs with Answers

Practice important System Programming MCQs with answers and explanations.

Chapter: 25
Q541:
Removing a directory using RemoveDirectory will fail if
A. the directory contains files
B. the path is null
C. the folder is in use
D. all of the above
Correct Answer: D
Chapter: 25
Q542:
SetCurrentDirectory and GetCurrentDirectory are used for
A. creating new folders
B. moving folders
C. managing current working directory
D. encrypting folders
Correct Answer: C
Chapter: 25
Q543:
Which function allows retrieval of the process's current directory path?
A. SetCurrentDirectory
B. GetPathName
C. GetCurrentDirectory
D. RemoveDirectory
Correct Answer: C
Chapter: 25
Q544:
CreateDirectory and RemoveDirectory both require
A. security attributes
B. path names
C. function names
D. log files
Correct Answer: B
Chapter: 25
Q545:
Directory path is passed in CreateDirectory using
A. LPSTR lpFileName
B. LPCTSTR lpPathName
C. int path
D. DWORD lpBuffer
Correct Answer: B
Chapter: 25
Q546:
The parameter lpSecurityAttributes in CreateDirectory is used to
A. define folder name
B. set user permissions
C. specify timestamps
D. define buffer size
Correct Answer: B
Chapter: 25
Q547:
Which function among the following sets the directory where process is currently operating?
A. GetCurrentDirectory
B. SetWorkingPath
C. SetCurrentDirectory
D. CreateDirectory
Correct Answer: C
Chapter: 25
Q548:
The return type of CreateDirectory is
A. BOOL
B. DWORD
C. INT
D. CHAR
Correct Answer: A
Chapter: 25
Q549:
To delete an empty directory in Windows, you should use
A. RemoveDirectory
B. DeleteFolder
C. DeleteDirectory
D. EraseDir
Correct Answer: A
Chapter: 25
Q550:
Removing a non-empty directory with RemoveDirectory will
A. result in TRUE
B. throw an exception
C. fail
D. return NULL
Correct Answer: C
Chapter: 25
Q551:
Directory management functions in Windows include
A. CreateDirectory, RemoveDirectory
B. SetFileAttributes, GetFileTime
C. DeleteDir, AddFolder
D. OpenDir, CloseDir
Correct Answer: A
Chapter: 25
Q552:
Current working directory can be changed using
A. SetDirectoryName()
B. ChangeDir()
C. SetCurrentDirectory()
D. MoveDirectory()
Correct Answer: C
Chapter: 25
Q553:
Security attributes in directory creation allow setting
A. user ownership
B. file type
C. sub-folder names
D. directory size limit
Correct Answer: A
Chapter: 25
Q554:
SetCurrentDirectory accepts which kind of argument?
A. buffer of integers
B. string path
C. pointer to security attribute
D. function name
Correct Answer: B
Chapter: 26
Q555:
What is generally considered to be the console in computer systems?
A. Printer and mouse
B. Hard drive and speaker
C. Monitor and keyboard
D. Monitor and printer
Correct Answer: C
Chapter: 26
Q556:
What does the OS treat the console devices as?
A. Network streams
B. Threads
C. Files
D. Programs
Correct Answer: C
Chapter: 26
Q557:
Which of the following APIs are specifically adapted for console I/O?
A. ReadFile() and WriteFile()
B. SendFile() and ReceiveFile()
C. ReadConsole() and WriteConsole()
D. ReadDisk() and WriteDisk()
Correct Answer: C
Chapter: 26
Q558:
ReadConsole and WriteConsole are preferred over generic file APIs because
A. They are faster
B. They process characters based on Console mode
C. They use less memory
D. They work on all devices
Correct Answer: B
Chapter: 26
Q559:
The SetConsoleMode API allows you to
A. set buffer size
B. set console colors
C. set console behavior modes
D. set thread priorities
Correct Answer: C
Chapter: 26
Q560:
Which data type is commonly used by console-based APIs for string handling?
A. char
B. TCHAR
C. wchar
D. STRINGS
Correct Answer: B

Test Your Knowledge

Take a timed quiz on System Programming

🚀 Start Quiz Now