Fundamentals of Programming MCQs (Part-9)

What is the main function of a compiler in programming?

A Execute code
B Interpret code
C Translate code
D Debug code

In Java, which of the following is used to create a graphical user interface (GUI)?

A java.gui
B java.io
C java.awt
D javax.swing

Which of these is a key feature of an interpreted language?

A Fast execution
B Immediate feedback
C Compilation required
D No debugging

What is the purpose of a web browser in web development?

A Interpret HTML, CSS, and JavaScript
B Display code
C Execute backend code
D Compile source code

In Python, which module is used to work with GUI applications?

A pyGUI
B os
C Tkinter
D socket

Which of the following is the first step in the process of compiling a C program?

A Preprocessing
B Linking
C Assembling
D Execution

In Java, which layout manager is used to arrange components in a grid?

A FlowLayout
B BorderLayout
C GridLayout
D BoxLayout

Which of these languages is an interpreted language?

A C
B Java
C C++
D Python

What does the javac command do in Java?

A Run the program
B Compile the code
C Interpret the code
D Debug the code

In web development, which language is primarily used for structuring content on the web?

A CSS
B JavaScript
C HTML
D PHP

In Python, which function is used to run a Tkinter application?

A root.mainloop()
B Tkinter.run()
C Tkinter.start()
D Tkinter.execute()

Which of the following is used to style a webpage in web development?

A HTML
B JavaScript
C PHP
D CSS

What is the key difference between compiled and interpreted languages?

A Compilation speed
B Memory usage
C Execution speed
D Error handling

Which Java class is used to handle user input from the console?

A Scanner
B FileReader
C BufferedReader
D Console

What is the primary use of the BufferReader class in Java?

A Reading characters from a file
B Reading bytes from a file
C Writing data to a file
D Reading integers from a file