The First Construct: if

  • The basic syntax of if in C/C++ is as follows:
  •    if (condition)
       {
           // Some commands...
       }
  • The meaning is that if the condition is satisfied, then the commands within the curly braces get executed.
  • Of course there are other variations in this if construct.
  • Let's look on at this in action.

 


Where to go

Chapter 2
News Page
Lesson 1 contents
Contacting Me


Roby Joehanes © 2001