โ† All CPA Flashcard Decks

Programming Fundamentals & Logic Flashcards

7 cards from real CPA practice questions. Tap to flip, then mark Knew It or Still Learning โ€” missed cards come back until you master them.

Read the first 7 Programming Fundamentals & Logic flashcards as text
  1. What is the output of the following pseudocode? x = 10; y = 3; print(x MOD y)

    Answer: 1

    The MOD (modulo) operator returns the remainder of 10 divided by 3, which is 1.

  2. Which data structure follows the Last-In, First-Out (LIFO) principle?

    Answer: Stack

    A stack follows LIFO, meaning the last element pushed is the first one popped.

  3. A variable declared inside a function that cannot be accessed outside it has what kind of scope?

    Answer: Local scope

    Variables declared inside a function have local scope and are inaccessible outside that function.

  4. What logical operator returns TRUE only when both operands are TRUE?

    Answer: AND

    The AND operator evaluates to TRUE only if both the left and right operands are TRUE.

  5. In a for-loop defined as 'for i = 1 to 5', how many times does the loop body execute?

    Answer: 5

    The loop iterates for i = 1, 2, 3, 4, 5, so the body executes exactly 5 times.

  6. Which of the following best describes a constant in programming?

    Answer: A named memory location whose value cannot be changed after assignment

    A constant is a named storage location whose value is fixed and cannot be modified after it is initially set.

  7. What is the result of evaluating: TRUE OR FALSE AND FALSE?

    Answer: TRUE

    AND has higher precedence than OR, so FALSE AND FALSE = FALSE first, then TRUE OR FALSE = TRUE.