mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 21:00:13 +01:00
Assisted-by: Claude and Antigravity with Gemini --------- Co-authored-by: Geoff Romer <gromer@google.com> Co-authored-by: josh11b <15258583+josh11b@users.noreply.github.com>
Control flow
Overview
Blocks of statements are generally executed linearly. However, statements are the primary place where this flow of execution can be controlled.
Carbon's flow control statements are:
ifandelseprovides conditional execution of statements.- Loops:
returnends the flow of execution within a function, returning it to the caller.