MCQ
Paper - II (v) — Programming Fundamentals MCQ - Practice Questions with Answers
Read the sample questions below. Explanations are shown where available.
Practice questions
Which option correctly combines a blockchain property with an advantage of an Integrated Development Environment?
A blockchain is tested as a distributed ledger concept: transactions are grouped into blocks and linked in a tamper-evident way. An Integrated Development Environment is tested separately as a productivity tool because it combines editor support, build or run actions, and debugging assistance in one workspace.
In Java, a class declaration uses the keyword implements with an interface name. What is the main implication of this declaration?
A Java interface is a contract for behavior. When a class declares that it implements an interface, the compiler expects the class to supply the methods required by that interface unless the class itself is abstract.
In Java, which keyword is used in a class declaration to inherit from another class?
Java uses the keyword extends when a class is declared as a subclass of another class. For example, a declaration such as class Child extends Parent establishes that Child inherits accessible members from Parent.
In a basic C program, which header file is normally included when the program uses printf() and scanf() for standard input and output?
In C, printf() and scanf() are standard library functions associated with formatted output and input. Their declarations are supplied through <stdio.h>, so including this header allows the compiler to check calls to these functions properly.
In C programming, a variable declared as static inside a function is used to count how many times that function has been called. Which statement correctly describes such a variable?
A static local variable in C differs from an ordinary local variable mainly in storage duration. Its name is usable only within the block where it is declared, but the object is not destroyed when the function call ends. Therefore it is suitable for preserving a counter across repeated calls of the function.
Sample questions on this page: 5
For package details, choose your exam and check the included practice, access period and final payable total. You do not need to buy anything to view sample questions.
More questions
In a C program, which loop is most suitable when the loop body must execute at least once before the condition is tested?
Which description most accurately captures machine learning at an introductory level?
In the .NET platform, what is the role of the Common Language Runtime?
Which feature is a practical advantage of using an Integrated Development Environment for a beginner writing C, Java, or Python programs?
A beginner is asked to design a program before coding. Which sequence follows a sound programming technique?
In Java, which keyword is used in a class declaration to inherit from a superclass?
Which Python data type is most appropriate when a program must store unique roll numbers and quickly test whether a roll number is already present?
In object-oriented programming, which pair best represents encapsulation?
In Python, which comparison between a list and a tuple is correct?
In C programming, which statement best describes why a function prototype is normally written before calling a user-defined function?
