Fundamentals of Programming MCQs (Part-3)

What is the main purpose of an IDE (Integrated Development Environment)?

A Compilation
B Code editing
C Debugging
D Program execution

Which of these types is used for storing text in C?

A float
B double
C int
D char

How is a single-line comment written in Python?

A #
B <!– –>
C //
D /* */

Which operator is used for modulo operation in Java?

A //
B %
C /
D //

Which of these is a looping construct in C?

A Pauses the loop
B forEach
C let
D while

What does the void keyword represent in C?

A Integer
B Null
C No value
D Undefined

How do you define a string in Python?

A string = Hello
B string = ‘Hello’
C string = “Hello”
D Both A and B

In Java, what does the new keyword do?

A Creates a method
B Allocates memory
C Defines a class
D Declares a variable

What does the continue statement do in a loop in C?

A Pauses the loop
B Exits the function
C Skips the current iteration
D Ends the loop

Which of the following is the correct syntax for an array in Python?

A arr = {1, 2, 3}
B arr = [1, 2, 3]
C arr = <1, 2, 3>
D arr = (1, 2, 3)

Which of these is used to access the value of an object’s property in Java?

A []
B ->
C ::
D .

What is the correct way to define a function in C?

A func name()
B void name()
C def name()
D function name()

Which of these operators is used for incrementing a variable by one in C?

A ++
B
C +
D +=

In Python, which function is used to get the length of a list?

A count()
B len()
C length()
D size()

What is the purpose of the break statement in a loop in Python?

A Exits the loop
B Ends the program
C Skips the iteration
D Pauses the loop