Fundamentals of Programming MCQs (Part-13)

What does the int data type represent in C?

A Float
B Integer
C String
D Character

In Java, which keyword is used to create a subclass?

A extends
B implements
C this
D super

Which of the following is true about compiled languages?

A Execute line by line
B Require an interpreter
C Run slower than interpreted
D Converted to machine code

In Python, what does the continue statement do inside a loop?

A Exits the loop
B Breaks the loop
C Skips the current iteration
D Stops the program

Which of the following is a feature of object-oriented programming?

A Compilation
B Inheritance
C Recursion
D Loops

In C, how do you declare a pointer?

A pointer int;
B int ptr;
C int ptr;
D ptr int;

Which of the following is a type of loop in Java?

A foreach
B repeat
C until
D do-while

In Python, which method is used to open a file for reading?

A open()
B load()
C fileopen()
D readfile()

Which of the following is a key feature of interpreted languages like Python?

A Line-by-line execution
B No debugging needed
C Compiled before execution
D Faster execution

In C, which function is used to allocate memory dynamically for an array?

A realloc()
B free()
C calloc()
D malloc()

What is the primary purpose of using functions in programming?

A Increase execution time
B Organize code
C Simplify debugging
D Increase memory usage

Which of the following is used to handle exceptions in Java?

A try-except
B assert
C catch
D throw

What does the return statement do in a function?

A Prints output
B Starts the function
C Exit the function and returns a value
D Ends the program

In Java, which of these is used to read input from the user?

A Console.read()
B Scanner.next()
C BufferedReader.read()
D System.input()

What does a class represent in Object-Oriented Programming (OOP)?

A A blueprint for objects
B A data type
C A collection of data
D A function definition