Abstract
In our program to solve a quadratic equation in Section1.2, the user could enter values of a, b and c, which make:
negative. In such cases the program would fail, but there is nothing we can do to prevent this with the techniques we have learned so far. All of our programs have a very simple control structure. In fact control just passes from one statement to the next, with no alternative pathway through a program. Our next task is to introduce iteration and branching techniques, but before we consider these control structures a few preliminaries are needed; in particular, some new operators must be introduced. You can find the precedence and associativity of these operators in Appendix B.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Rights and permissions
Copyright information
© 2001 Springer-Verlag London
About this chapter
Cite this chapter
Capper, D. (2001). Control Structure. In: Introducing C++ for Scientists, Engineers and Mathematicians. Springer, London. https://doi.org/10.1007/978-1-4471-0267-0_4
Download citation
DOI: https://doi.org/10.1007/978-1-4471-0267-0_4
Publisher Name: Springer, London
Print ISBN: 978-1-85233-488-8
Online ISBN: 978-1-4471-0267-0
eBook Packages: Springer Book Archive