Skip to main content
  • 741 Accesses

Abstract

In our program to solve a quadratic equation in Section1.2, the user could enter values of a, b and c, which make:

$${b^2} - 4ac$$

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

eBook
USD 16.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 79.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Authors

Rights and permissions

Reprints 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

Publish with us

Policies and ethics