csmasters.dev
Untitled Pseudocode
Cambridge Syllabus Templates
0478 & 9618
Cambridge Syntax Reference
Variables & Assignment
0478 & 9618
DECLARE X : INTEGER DECLARE Msg : STRING X <- 10 Msg <- "Cambridge CS"
Input & Output
0478 & 9618
INPUT UserValue OUTPUT "Result: ", UserValue
Selection (IF & CASE)
0478 & 9618
IF Condition THEN
// Code
ELSE
// Code
ENDIF
Loops (FOR, WHILE, REPEAT)
0478 & 9618
FOR i <- 1 TO 10
OUTPUT i
NEXT i
WHILE x > 0 DO
x <- x - 1
ENDWHILE
REPEAT
x <- x + 1
UNTIL x = 10
1D & 2D Arrays
0478 & 9618
DECLARE Arr : ARRAY[1:10] OF STRING Arr[1] <- "Cambridge" DECLARE Matrix : ARRAY[1:5, 1:5] OF REAL
Subroutines (Procedures & Functions)
0478 & 9618
PROCEDURE Greet(Name : STRING)
OUTPUT "Hello ", Name
ENDPROCEDURE
CALL Greet("Alex")
Explicit BYREF and BYVAL parameter modes are 9618 extensions.
Built-in Functions
0478 & 9618
LENGTH(Str), UCASE(Str), LCASE(Str) SUBSTRING(Str, Start, Len) INT(RealNum), NUM_TO_STR(Num) DIV, MOD, ROUND(RealNum, Places), RANDOM()
Composite Types (TYPE)
9618 only
TYPE Student
DECLARE Name : STRING
DECLARE Score : INTEGER
ENDTYPE
File Handling
0478 & 9618
OPENFILE "Data.txt" FOR READ READFILE "Data.txt", Line CLOSEFILE "Data.txt"
No syntax matches found for your search.
algorithm.pc
Cambridge Pseudocode Engine ready. Press ▶ Run Code or ⌘+Enter to execute.
Waiting for Input:
Run code to inspect step-by-step variable trace states.
Share Pseudocode Snippet
Account Required
Sign in or create a free account to save pseudocode algorithms, generate permanent share links, track daily streaks, and earn XP.
Keyboard Shortcuts
Run Pseudocode
Run algorithm in browser
Save / Share Snippet
⌘
+
S
Open / Import File
⌘
+
O
Export File
Export / Download .pseudo file
Indent / Outdent Code
⌘
Ctrl
+
]
/
⌘
Ctrl
+
[
Move Focus
Tab
Toggle Line Comments
⌘
Ctrl
+
/
Toggle Shortcuts Dialog
?