© Slobodan Dmitrović 2021
S. DmitrovićModern C for Absolute Beginnershttps://doi.org/10.1007/978-1-4842-6643-4_7

7. Statements

Slobodan Dmitrović1  
(1)
Belgrade, Serbia
 

This section explains statements in general – expressions ending with a semicolon (;) and statements built into the language itself.

7.1 Introduction

What is a statement? A statement is an expression ending with a semicolon symbol (;). For example, x + y is an expression, but x + y; is a statement. Let us list a few simple statements we have used so far:
  • int x; – a statement containing a declaration

  • int x = 123; – a statement containing an initialization

  • x = 123; – a simple assignment statement

  • z = x + y; – a statement with multiple expressions

  • x++; – a statement having a postfix increment ...

Get Modern C for Absolute Beginners: A Friendly Introduction to the C Programming Language now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.