Fundamental programming mcqs

Fundamental Programming Questions and Answers

Fundamental Programming MCQs are given here which are very important questions for initial tests of Pak Army ICTOs Tests, Pak Navy ICTOs Tests, PAF IT Branch Officers tests and all those tests which are related to the information technology. Also these Fundamental Programming MCQs are very important for Education Branch Officers’ tests of Army, Navy and PAF.

  • _________ is NOT a fundamental programming concept.  (Inheritance)
  • The purpose of a loop in programming is            .  (To control the flow of execution)
  • _______data type is used to store whole numbers in programming.  (Integer)
  • The term “DRY” stand for in programming is               . (Don’t Repeat Yourself)
  • _________ is the purpose of using functions in programming.  (To define a block of reusable code)
  • The result of the following expression: 5 + 3 x 2 is              .  (13)
  • C programming language is considered a              .  (High-level language)
  • ________ is the purpose of conditional statements in programming.  (To control the flow of execution based on certain conditions)
  • The output of the following code , x = 5, y = 2, print(x % y) is              .  (1)
  • _______ is the purpose of comments in programming.  (To add explanations and make the code more readable)
  • _____ is a primitive data type in most programming languages. (Boolean)
  • _____ data type is used to store characters in programming. (Char)
  • _____ is NOT a numeric data type.  (String)
  • ______data type is used to store whole numbers without fractional parts. (Integer)
  • _____ data type is used to store true or false values. (Boolean)
  • _____ data type is used to store decimal numbers in programming. (Float)
  • _____ data type is used to store a sequence of characters. (String)
  • _____ data type is used to represent a large floating-point number with double precision. (Double)
  • data type is used to represent a collection of values of the same type. (Array)
  • _____ data type is used to store memory addresses. (Pointer)
  • ______ operator is used for exponentiation in most programming languages.  (**)
  • ______ is the value of the expression 10 / 3 in integer division.  (3)
  • _____ operator is used to calculate the remainder of a division operation. (%)
  • ______ is the value of the expression 15 % 4. (3)
  • ______ operator is used to perform multiplication in most programming languages.  (*)
  • _____ is the result of the expression 10 – 6 / 2.   (4)
  • _____ operator is used to perform addition in most programming languages.   (+)
  • ______ is the result of the expression 25 / 4 in floating-point division.  (6.25)
  • ______ operator is used to perform subtraction in most programming languages.   (-)

Fundamental Programming Important MCQs with Answers

More fundamental programming mcqs are given here to pass the initial tests of ICTOs in Pak Army, Pak navy and PAF tests.

  • _____ control structure allows code execution to be repeated based on a condition.  (Loop statement)
  • _____ control structure is used for making decisions based on a condition. (If-else statement)
  • _____ control structure allows multiple conditions to be tested using different cases.   (Switch statement)
  • _____ control structure is used to handle exceptional situations in programming.  (Exception handling)
  • ______ is NOT a type of loop statement.   (If-else loop)
  • _____ loop statement executes the code block at least once, even if the condition is false.   (Do-while loop)
  • ______ control structure allows code execution to jump to a specific labeled statement.  (Goto statement)
  • _____ control structure is used to exit from a loop or a function prematurely.   (Break statement)
  • ______ control structure is used to skip the current iteration of a loop and continue with the next iteration.   (Continue statement)
  • _______ control structure allows nesting of one control structure within another.   (Loop statement)
  • A function in programming is              .  (A block of code that performs a specific task)
  • The purpose of using functions in programming is               .  (To define a block of reusable code)
  • ______ is NOT a benefit of using functions.  (Enhanced code performance)
  • The term used to describe sending data to a function is called               . (Function arguments)
  • _____ is the term used to describe the data that a function returns after its execution.  (Return values)
  • The purpose of function parameters is              .  (To pass data to a function)
  • ______ is NOT a type of function in programming.  (Loop functions)
  • The value returned by a function called “calculateAverage” that takes two numbers as input and returns their average is                 . (The average of the two numbers)
  • ______ keyword is typically used to define a function in most programming languages.  (Method)
  • ______ is the process of calling a function within the function itself called. (Function recursion)
  • An array in programming is              (A collection of variables of the same data type)
  • _____ is true about array indices.  (Indices always start from 0)
  • We can access an element in an array              . (By using the array name followed by the index in square brackets)
  • The length of an array is                 . (The number of elements in the array)
  • The size of an array is fixed and cannot be changed. The statement is                . (Correct)
  • The process of storing data in an array called                . (Initialization)
  • _____ is NOT a valid data type for elements in an array.  (Object)
fundamental programming questions for ICTO

Fundamental Programming Past Papers MCQs

  • The index of the last element in an array with a length of n is             . (n – 1)
  • _____ is an example of a two-dimensional array.  [[1, 2, 3], [4, 5, 6]]
  • A valid way to initialize an array in most programming languages is              .(array = [1, 2, 3])
  • An algorithm is                . (A step-by-step procedure to solve a problem)
  • _____ is true about algorithms.   (Algorithms are independent of programming languages)
  • The primary goal of designing an algorithm is                 (To maximize the efficiency of the program)
  • _____ is NOT an example of an algorithm.  (Printing “Hello, World!” on the screen)
  • The time complexity of an algorithm is                . (The efficiency of an algorithm in terms of time)
  • _____ is an example of a linear search algorithm. (Sequential search)
  • _____ sorting algorithm has the worst-case time complexity of O(n2).(Bubble sort)
  • _____ is a divide-and-conquer algorithm for sorting. (Quick sort)
  • _____ data structure is typically used to implement a stack. (Linked list)
  • ______ is an example of a greedy algorithm.  (Huffman coding algorithm)
  • _____ A graph data structure is              . (A data structure that stores elements in a network-like structure)
  • ______ is NOT a component of a graph.  (Root)
  • A directed graph is             . (A graph where edges have a specific direction)
  • A weighted graph is               . (A graph where edges have weights assigned to them)
  • _____ traversal algorithm is commonly used to traverse a graph. (Breadth -First Search (BFS))
  • _____ algorithm is commonly used to find the shortest path in a weighted graph.   (Dijkstra’s algorithm)
  • ____ algorithm is commonly used to find the minimum spanning tree in a weighted graph.  (Prim’s algorithm)
  • _____ is NOT a representation of a graph.  (Heap)
  • _____ is NOT a graph traversal algorithm.  (Quick Sort)
  • _____ data structure is commonly used to implement a graph. (Linked List (or an array of linked lists))
  • An abstraction in programming is          .  (A way to minimize the complexity of a program)
  • The purpose of abstraction in object-oriented programming               . (To hide the internal implementation details of an object)
  • An example of abstraction in programming is                 (Defining a class to represent a car with properties and methods)
  • The benefit of using abstraction in programming is               . (Improved code efficiency, Enhanced code readability, Increased code maintainability)
  • In object-oriented programming, an abstract class is              . (A class that cannot be instantiated and can only be inherited)
  • _____ is true about interfaces in Java.  ( A class can implement multiple interfaces)

Basics of Fundamental Programming Questions Online

  • ______ is an example of data abstraction.  (Encapsulation of data within a class)
  • The main goal of abstraction in software engineering is              .  (To simplify complex systems and make them more manageable)
  • _____ programming principle is closely related to abstraction. (Encapsulation, Inheritance, Polymorphism)
  • File handling in programming is             (The process of reading and writing data to and from files)
  • _____ is NOT a commonly used file operation.  (Copying a file)
  • ____ is an example of a text file.  (Configuration file (e.g., .txt, .csv))
  • _____ is true about file modes in Python. (The “r” mode is used for reading a file, The “w” mode is used for writing to a file, The “a” mode is used for appending to a file)
  • If you try to open a file in Python with the “w” mode that does not exist, then what happens                . (A new file is created)
  • _____ file operation is used to read the entire contents of a file in Python.(read() )
  • _____ file operation is used to write data to a file in Python. (write() )
  • _____ Python function is used to check if a file exists.  (os.path.exists() )
  • ______ Python module is commonly used for file handling.  (os)
  • In programming, a variable is used to ________ data in a program. (store)
  • The process of finding and fixing errors in a program is known as ________. (debugging)
  • A loop that continues to execute as long as a specified condition is true is called a ________ loop. (while)
  • The statement that is used to make a decision in a program is called an ________ statement. (if)
  • The term used to describe breaking down a problem into smaller, more manageable parts is ________. (decomposition)
  • The basic building block of object-oriented programming is a ________. (class)
  • A programming language that is designed to be easy for humans to read and write is known as a ________ language. (high-level)
  • The process of converting high-level code into machine code is called ________. (compilation)
  • A function that calls itself is called a ________ function. (recursive)
  • The process of combining multiple source code files into a single executable program is called ________. (linking)
Internet MCQs

Basic Internet MCQs

Internet MCQs Online multiple-choice questions (MCQs) are a great tool for people getting ready for the entrance exams of prestigious military branches including the Army, Navy, and Pakistan Air Force…
Read More Basic Internet MCQs
Computer Hardware

Computer Hardware MCQs

Computer Hardware MCQs Questions and Answers In the Army, Navy, and Pakistan Air Force (PAF) initial academic exams, Computer Hardware MCQ Questions ans Answers are crucial. These Computer Hardware multiple-choice…
Read More Computer Hardware MCQs

Similar Posts