What Pseudo Code Is

Common Conventions

BEGIN
  READ n
  SET sum = 0
  FOR i = 1 TO n DO
     sum = sum + i
  END FOR
  PRINT sum
END

Why It's Used

Exam Angle

When asked to "write an algorithm" in the CS-optional paper, pseudo code (not full C++ syntax) is usually the expected answer format — focus on clear structured steps over compilable syntax.

📌 Sample & Repeated FPSC Questions (2016–2026)

2026, Paper I, Q3(c) (8 marks) — Write pseudocode to reverse an array using pointers.

Function ReverseArray(arr, n):
    left  <- pointer to arr[0]           // first element
    right <- pointer to arr[n-1]         // last element

    while left < right:                  // pointers haven't crossed
        temp   <- *left
        *left  <- *right
        *right <- temp
        left   <- left + 1
        right  <- right - 1

    return arr

Key reasoning points: