Chapter 7. C CONTROL STATEMENTS: BRANCHING AND JUMPS

I l @ ve RuBoard

Chapter 7. C CONTROL STATEMENTS: BRANCHING AND JUMPS

You will learn about the following in this chapter:

  • Keywords

     if, else, switch, continue break, case, default, goto 
  • Operators

     &&  ?: 
  • Functions

     getchar(), putchar(), the ctype.h family 

In this chapter, you learn how to use the if and if else statements and how to nest them. You use logical operators to combine relational expressions into more involved test expressions. You encounter C's conditional operator; study the switch statement; learn about the break , continue , and goto jumps; and use C's character I/O functions ” getchar() and putchar() . You also learn about the family of character-analysis functions provided by the ctype.h header file.

As you grow more comfortable with C, you will probably want to tackle more complex tasks . When you do, you'll need ways to control and organize these projects. C has the tools to meet these needs. Already, you've learned to use loops to program repetitive tasks. In this chapter, you'll learn about branching structures, such as if and switch , that allow a program to base its actions on conditions it checks. Also, you are introduced to C's logical operators, which enable you to test for more than one relationship in a while or if condition, and you look at C's jump statements, which shift the program flow to another part of a program. By the end of this chapter, you'll have all the basic information you need to design a program that behaves the way you want.

I l @ ve RuBoard


C++ Primer Plus
C Primer Plus (5th Edition)
ISBN: 0672326965
EAN: 2147483647
Year: 2000
Pages: 314
Authors: Stephen Prata

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net