OUTPUT and sequence · SAÍDA e sequência
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version. · Esta página precisa de um navegador recente (com suporte a SharedArrayBuffer). Por favor, atualize Chrome, Edge, Firefox ou Safari para a versão mais recente.
English
Pseudocode is the exam's language
- Cambridge International AS Computer Science 9618 writes algorithms in pseudocode.
- Use the guide for exams in 2026. The guide for 2027, 2028 and 2029 uses the same syntax.
- Statements run from top to bottom. That order is sequence.
Português
Pseudocódigo é a linguagem do exame
- Cambridge International AS Computer Science 9618 escreve algoritmos em pseudocódigo.
- Use o guia para exames em 2026. O guia para 2027, 2028 e 2029 usa a mesma sintaxe.
- As instruções são executadas de cima para baixo. Essa ordem é a sequência.
OUTPUT "Wake up"
OUTPUT "Brush teeth"
OUTPUT "Go to school"
Explore · Explorar
One line after another · Uma linha após a outra
Pseudocode runs top to bottom — each line after the one above it. · Pseudocódigo roda de cima para baixo — cada linha após a anterior.
English
OUTPUT shows a value
OUTPUTdisplays a value. Text goes in double quotes.- Each
OUTPUTstarts a new line. - Several values, separated by commas, print on one line.
Português
OUTPUT mostra um valor
OUTPUTexibe um valor. O texto vai entre aspas duplas.- Cada
OUTPUTinicia uma nova linha. - Vários valores, separados por vírgulas, são impressos em uma linha.
OUTPUT "Hello, world!"
OUTPUT "You have ", 3, " lives left"
English
Watch out
- Keywords are capitals:
OUTPUT, notprint. - A comma keeps values on one line. A new
OUTPUTstarts the next line. - Joining two strings with
&is taught with the string functions.
Português
Atenção
- Palavras-chave são maiúsculas:
OUTPUT, nãoprint. - Uma vírgula mantém os valores em uma linha. Um novo
OUTPUTinicia a próxima linha. - Juntar duas strings com
&é ensinado junto às funções de string.
English
Common mistakes
- Text needs quotes. A number does not:
OUTPUT 42. - Comments start with
//and run to the end of the line.
Português
Erros comuns
- Texto precisa de aspas. Um número não:
OUTPUT 42. - Comentários começam com
//e vão até o fim da linha.
English
Now you try
- Type pseudocode in the box, then press Run.
- Press Check answer to test it.
Português
Agora você tenta
- Digite pseudocódigo na caixa, depois pressione Executar.
- Pressione Check answer para testá-lo.
Use OUTPUT to print the word Hello. · Use OUTPUT para imprimir a palavra Hello.
Click Run to see the output here. · Clique em Executar para ver a saída aqui.
Print Red, Green and · e Blue, one per line, in that order. · Imprima Red, Green e Blue, um por linha, nessa ordem.
Click Run to see the output here. · Clique em Executar para ver a saída aqui.
On one line, output You have , the number 3, then lives left. · Em uma linha, saia You have , o número 3, então lives left.
Click Run to see the output here. · Clique em Executar para ver a saída aqui.