Skip to content · ⁨Pular para o conteúdo⁩

How many halvings? · ⁨Quantas divisões por dois?⁩

English

How many halvings?

n starts at 40. Halve it with n = n // 2 until it reaches 0, counting the steps in steps.

// divides and throws the remainder away, so 5 // 2 is 2. Counting how many times a loop went round needs its own variable, going up by one each turn.

Português

Quantas divisões por dois?

n começa em 40. Divida por dois com n = n // 2 até chegar em 0, contando os passos em steps.

// divide e descarta o resto, então 5 // 2 é 2. Contar quantas vezes um loop rodou precisa de sua própria variável, somando um a cada volta.

Log in or create account · ⁨Entrar ou criar conta⁩

IGCSE, A-Level & AP