Author: Marinko Spasojevic

C# Back to Basics – Loops in C#

In this article, we are going to learn how to use loops in C#, what type of loops exist, and when to use them. We will use a couple examples to closely explain the usage of each loop in C#. For the complete navigation of this series check out: C# Back to Basics. If you want to download the source code for our examples, you can do that from here Loops in C# Source Code. Let’s dig in. In this article, we are going to talk about: While Loop For Loop Do-While Loop While Loop While loop is a...

Read More

C# Back to Basics – Conditions in C#

In this article, we are going to talk about condition statements in C#. We will learn how to write simple condition statements, nested condition statements, and multiple condition statements. For the complete navigation of this series check out: C# Back to Basics. If you want to download the source code for our examples, you can do that from here Conditions in C# Source Code. Let’s begin. Basic Condition Statements If we want to execute some expression but only if some condition is met, then we need to use conditional statements. To create such a statement we need to use...

Read More

C# Back to Basics – Work With Strings

The string type represents a character array, and its length is determined by the Length property. All the character positions inside that string are enumerated from 0 to Length-1. C# provides us with many different methods to work with strings and we are going to examine ones that are used most of the time. For the complete navigation of this series check out: C# Back to Basics. If you want to download the source code for our examples, you can do that from here Work With Strings Source Code. So, let’s start. We will learn about the following topics:...

Read More

C# Back to Basics – Input and Output in C#

In this article, we are going to learn how to solve simple problems by using linear structures. We are going to accept inputs, work with them and print the output to the console window. For the complete navigation of this series check out: C# Back to Basics. If you want to download the source code for our examples, you can do that from here Input and Output Source Code. So let’s start. Example 1: Create an application that prints out the sum of two integer values which user inputs in the console window. Let’s create a new console application...

Read More

C# Back to Basics – Type Conversion

In C#, data can be converted from one type to another by using an implicit conversion (automatic) or an explicit conversion (we can choose how it’s done). For the complete navigation of this series check out: C# Back to Basics. So, let’s talk more about that. In this article, we are going to cover: Implicit Conversion Explicit Conversion Conclusion Implicit Conversion Many different data could be interpreted by using different types. For example, number 74 can be interpreted as an integer but also as double (74.0). There are two situations in which implicit conversion applies. The first one is...

Read More