String handling operations in a programming language

EasyMedium
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
Question 53
Easy

An algorithm is shown in the pseudo-code below:

1  cities ← ['Tokyo', 'Paris']
2  city1 ← 'Berlin'
3  city2 ← 'London'
4  OUTPUT city2
5  OUTPUT LEN(cities)
6  part ← SUBSTRING(0, 4, city1)
7  OUTPUT part

Note: SUBSTRING(start, length, string) extracts a section of a string starting at index start (where the first character is at index 0) for the given character length.

State the output of line 7 from this algorithm.

[1]

String handling operations in a programming language Questions

  1. GCSE
  2. /Computer Science
  3. /String handling operations in a programming language