New here? Welcome! This is a free online code Interpreter-Compiler for learning programming.
Tip: Create an account to save programs online!
Create a free account to unlock:
Click "📝 Register" to create a free account!
OUTPUT "A" ; prints without newline' comment or // commentComplete guide to Cambridge 9618 pseudocode syntax supported by this platform.
DECLARE Counter : INTEGER
DECLARE Price : REAL
DECLARE Name : STRING
DECLARE Flag : BOOLEAN
DECLARE Letter : CHAR
DECLARE BirthDate : DATE
✓ Also works: x = 10 (direct assignment)
CONSTANT Pi = 3.14159
CONSTANT MaxStudents = 30
CONSTANT SchoolName = "Dhaka High"
DECLARE Names : ARRAY[1:30] OF STRING
DECLARE Scores : ARRAY[1:100] OF INTEGER
DECLARE Grid : ARRAY[1:10,1:10] OF REAL
// Accessing elements:
Names[5] = "Ahmed"
Grid[2,3] = 99.5
✓ Also works: DIM Names(30) then Names(5) = "Ahmed"
x ← 10 // Arrow operator
x = 10 // Equals sign (also works)
INPUT x
INPUT "Enter name: ", name
OUTPUT "Hello"
OUTPUT x ; y ; z // Multiple values
IF x > 5 THEN
OUTPUT "Big"
ENDIF
IF x > 5 THEN
OUTPUT "Big"
ELSE
OUTPUT "Small"
ENDIF
✓ Also works: END IF (two words)
FOR i ← 1 TO 10
OUTPUT i
NEXT i
FOR i ← 10 TO 1 STEP -1
OUTPUT i
NEXT i
✓ Also works: FOR i = 1 TO 10
WHILE count < 10
count ← count + 1
ENDWHILE
✓ Also works: END WHILE or WEND
REPEAT
OUTPUT "Try again"
INPUT answer
UNTIL answer = "yes"
CASE OF grade
"A" : OUTPUT "Excellent"
"B" : OUTPUT "Good"
OTHERWISE : OUTPUT "Try harder"
ENDCASE
✓ Also works: SELECT CASE / END SELECT
PROCEDURE Greet(name : STRING)
OUTPUT "Hello " ; name
ENDPROCEDURE
CALL Greet("Ahmed")
✓ Also works: SUB / END SUB
FUNCTION Square(n : INTEGER) RETURNS INTEGER
RETURN n * n
ENDFUNCTION
result ← Square(5)
✓ Platform: Assign to function name: Square = n * n
// Arithmetic: + - * / DIV MOD
// Comparison: = <> < > <= >=
// Logical: AND OR NOT
// String: & (concatenation)
LENGTH("Hello") // Returns 5
LEFT("Hello", 3) // Returns "Hel"
RIGHT("Hello", 2) // Returns "lo"
MID("Hello", 2, 3) // Returns "ell"
UCASE('a') // Returns 'A'
LCASE('A') // Returns 'a'
"Hi" & " " & "there" // Returns "Hi there"
✓ Platform uses: LEN() instead of LENGTH()
Check the Reference panel in the left sidebar for full commands.
Try the Examples - they're great for learning!
Contact: Omer Mesbah, WhatsApp: +8801711-362139, Email: admin@omssoft.com