A+ Examples





Generated by AI, corrected by PeatSoft
The Unicode characters can cause run-time errors, depending on the software.

  1. Simple Arithmetic
    
       2 + 3   ⍝ Addition
    5
    
       10 - 4  ⍝ Subtraction
    6
    
       5 « 2   ⍝ Multiplication
    10
    
       10 ß 2  ⍝ Division
    5
    

  2. 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