A+ Examples
Generated by AI, corrected by PeatSoft
The Unicode characters can cause run-time errors, depending on the software.
-
Simple Arithmetic
2 + 3 ⍝ Addition
5
10 - 4 ⍝ Subtraction
6
5 « 2 ⍝ Multiplication
10
10 ß 2 ⍝ Division
5
-
Arrays
numbers û 1 2 3 4 5 ⍝ Create an array
OR
numbers ← 1 2 3 4 5 ⍝ Create an array
1 2 3 4 5
numbers + 1 ⍝ Add 1 to each element
2 3 4 5 6
numbers « 2 ⍝ Multiply each element by 2
2 4 6 8 10
numbers[1] ⍝ Access the first element (indexing starts at 0)
2