© 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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.