3.1 Introduction

We now introduce C# programming. Most of the C# apps you’ll study in this book process information and display results. In this chapter, we introduce console apps—these input and output text in a console window, which in Windows is known as the Command Prompt.

We begin with several examples that simply display messages on the screen. We then demonstrate an app that obtains two numbers from a user, calculates their sum and displays the result. You’ll perform various arithmetic calculations and save the results for later use. Many apps contain logic that makes decisions—the last example in this chapter demonstrates decision-making fundamentals by showing you how to compare numbers and display messages based on the comparison results. For example, the app displays a message indicating that two numbers are equal only if they have the same value. We analyze each code example one line at a time.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset