Introduction to C# Apps
- 3.1. Introduction
- 3.2. A Simple C# App: Displaying a Line of Text
- 3.3. Creating a Simple App in Visual Studio
- 3.4. Modifying Your Simple C# App
- 3.5. Formatting Text with Console.Write and Console.WriteLine
- 3.6. Another C# App: Adding Integers
- 3.7. Arithmetic
- 3.8. Decision Making: Equality and Relational Operators
- 3.9. Wrap-Up
We now introduce C# app 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 comparing numbers and then displaying 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.