Programming Test: Arrays And Loops

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By Gregorynaomi
G
Gregorynaomi
Community Contributor
Quizzes Created: 1463 | Total Attempts: 755,840
Questions: 10 | Attempts: 269

SettingsSettingsSettings
Programming Test: Arrays And Loops - Quiz

Programmers who are in the know consider it a useful data structure which consists of a number of variables and values. Each variable that is associated with an element is often identified by a key or index. Do you know each array can be computed using a certain mathematical formula? Try this quiz now!


Questions and Answers
  • 1. 

    Which of these programming languages does have support for multi-dimensional arrays?

    • A.

      C

    • B.

      FORTRAN 

    • C.

      COBOL 

    • D.

      Ruby 

    Correct Answer
    D. Ruby 
    Explanation
    Ruby is the correct answer because it does have support for multi-dimensional arrays. In Ruby, arrays can be nested within other arrays to create multi-dimensional arrays. This allows for the storage and manipulation of data in multiple dimensions, such as rows and columns. This feature is useful for tasks that require working with matrices, tables, or grids of data.

    Rate this question:

  • 2. 

    Which of these does not require arrays?

    • A.

      Heaps 

    • B.

      String 

    • C.

      Queues 

    • D.

      Loops 

    Correct Answer
    D. Loops 
    Explanation
    Loops do not require arrays. Loops are control structures used to repeatedly execute a block of code until a certain condition is met. They can be implemented using variables, conditions, and iteration statements, without the need for arrays. Arrays, on the other hand, are data structures used to store and manipulate collections of elements of the same type. Heaps, strings, and queues can all be implemented using arrays or other data structures, but loops do not inherently require arrays.

    Rate this question:

  • 3. 

    Which of these connotes condition?

    • A.

      IF

    • B.

      @IT#

    • C.

      Can 

    • D.

      Ahrefs 

    Correct Answer
    A. IF
    Explanation
    The correct answer is "IF" because "IF" is a conditional word that introduces a condition or a hypothetical situation. It is commonly used in conditional statements or clauses to express a possibility or a requirement that must be met for something else to happen.

    Rate this question:

  • 4. 

    Which of these is not used to pack these parameters? 

    • A.

      Vector processor 

    • B.

      Dope vector 

    • C.

      String 

    • D.

      Lists 

    Correct Answer
    B. Dope vector 
    Explanation
    A dope vector is not used to pack these parameters. A dope vector is a data structure used in some programming languages to store additional information about an array, such as its size, dimensions, and element type. It is not used specifically for packing parameters. Parameters can be packed using other methods such as using a vector processor, strings, or lists.

    Rate this question:

  • 5. 

    What element does ALGOL use?

    • A.

      Do

    • B.

      Can

    • C.

      For 

    • D.

      Will

    Correct Answer
    C. For 
    Explanation
    ALGOL uses the element "For" in its programming language. "For" is a control structure used for looping and iterating over a set of values or a range of numbers in ALGOL. It allows the programmer to specify the starting point, end point, and the increment or decrement value for the loop. This element is crucial in ALGOL as it enables the execution of repetitive tasks and helps in writing efficient and concise code.

    Rate this question:

  • 6. 

    What element does Fortran use?

    • A.

      Do

    • B.

      For 

    • C.

      Is 

    • D.

      Can

    Correct Answer
    B. For 
    Explanation
    Fortran uses the "Do" element. In Fortran, the "Do" statement is used for loop control. It allows a specific block of code to be repeated a certain number of times or until a certain condition is met. The "Do" element is an essential part of the Fortran programming language and is used for efficient and structured looping in order to perform repetitive tasks.

    Rate this question:

  • 7. 

    How many parts does a for-loop have?

    • A.

      Two parts 

    • B.

      Nine parts 

    • C.

      Four parts 

    • D.

      Six parts 

    Correct Answer
    A. Two parts 
    Explanation
    A for-loop has two parts: the initialization and the loop condition. The initialization is where the loop variable is initialized, and the loop condition is where the condition for the loop to continue running is specified. These two parts work together to control the iteration of the loop, allowing it to execute statements repeatedly until the loop condition becomes false.

    Rate this question:

  • 8. 

    What does the header of a for-loop specify?

    • A.

      End 

    • B.

      Array 

    • C.

      List 

    • D.

      Iteration 

    Correct Answer
    D. Iteration 
    Explanation
    The header of a for-loop specifies the iteration. It contains the initialization, condition, and increment/decrement statements that control how many times the loop will execute. The iteration is the number of times the loop will repeat its block of code before terminating.

    Rate this question:

  • 9. 

    Which of these is not a type of for-loop?

    • A.

      Traditional for-loops

    • B.

      Iterator-based for-loops 

    • C.

      Special for-loops 

    • D.

      Vectorised for-loops 

    Correct Answer
    C. Special for-loops 
    Explanation
    The given correct answer is "Special for-loops." This is not a type of for-loop because it is not a commonly recognized or widely used category of for-loop. Traditional for-loops, iterator-based for-loops, and vectorized for-loops are all well-known types of for-loops that are commonly used in programming. However, "Special for-loops" is not a recognized category and therefore not a valid option.

    Rate this question:

  • 10. 

    Which of these languages does not support for-loops?

    • A.

      BASIC 

    • B.

      Modula 

    • C.

      Python

    • D.

      Pascal 

    Correct Answer
    C. Python
    Explanation
    Python does not support for-loops. Unlike BASIC, Modula, and Pascal, Python uses a different syntax for loops called "while" loops. While loops allow the execution of a block of code repeatedly as long as a certain condition is true, whereas for-loops are used to iterate over a sequence or range of values a specific number of times. Therefore, Python is the correct answer as it does not have a built-in for-loop construct.

    Rate this question:

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 19, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Jul 09, 2019
    Quiz Created by
    Gregorynaomi
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.