© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2021
R. VystavělC# Programming for Absolute Beginnershttps://doi.org/10.1007/978-1-4842-7147-6_17

17. Compound Conditions

Radek Vystavěl1  
(1)
Ondřejov, Czech Republic
 

You have now some experience formulating conditions and using them to solve real problems. As to more complex problems, what you often need is to assemble your condition out of two or more partial conditions. This is what you will study in this chapter.

Yes or No

Your first use of compound conditions will be to check that the user input belongs to one of the allowed alternatives.

Task

You will write a program that checks whether the user entered either yes or no. All other inputs will be considered ...

Get C# Programming for Absolute Beginners: Learn to Think Like a Programmer and Start Writing Code now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.