Skip to Main Content
Learn to Program with C
book

Learn to Program with C

by Noel Kalicharan
December 2015
Beginner content levelBeginner
336 pages
7h 4m
English
Apress
Content preview from Learn to Program with C

CHAPTER 4

image

Programs with Selection Logic

In this chapter, we will explain the following:

  • What are Boolean expressions
  • How C represents Boolean values
  • How to write programs using if
  • How to write programs using if...else
  • Where semicolons are required, where they are optional, and where they must not be put
  • How a program should be tested
  • Why symbolic constants are useful and how to use them in a C program

4.1 Introduction

In the last chapter, we showed how to write programs using sequence logic—programs whose statements are executed “in sequence” from the first to the last.

In this chapter, the programs will use selection logic—they will test some ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Sudoku Programming with C

Sudoku Programming with C

Giulio Zambon
Learning C for Arduino

Learning C for Arduino

Syed Omar Faruk Towaha

Publisher Resources

ISBN: 9781484213711Purchase book