© Radek Vystavěl 2017

Radek Vystavěl, C# Programming for Absolute Beginners, https://doi.org/10.1007/978-1-4842-3318-4_22

22. Number Series

Radek Vystavěl

(1)Ondřjov, Czech Republic

Several programming tasks reduce to generating regular number series. This is what you are going to study in this chapter. You will also get a better understanding of loops this way.

Every Other

You are already able to generate a simple number series, say from one to ten. You will tackle generating a bit more complex series now.

Task

In this task, you will display “every other” number until 20 (see Figure 22-1).

A458464_1_En_22_Fig1_HTML.jpg
Figure 22-1 Displaying every other number

Solution

Here’s ...

Get C# Programming for Absolute Beginners now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.