C#: Programming Basics for Absolute Beginners (Step-By-Step C# Book 1) by Nathan Clark

C#: Programming Basics for Absolute Beginners (Step-By-Step C# Book 1) by Nathan Clark

Author:Nathan Clark
Language: eng
Format: azw3, epub, pdf
Publisher: Nathan Clark
Published: 2016-12-15T08:00:00+00:00


Let’s take a look at how the “if else” statement could work in real life.

If ( x > 0)

{

Console.Write(“This value will be positive.”);

}

Else

{

Console.Write(“The value is less than or equal to zero.”)

}

In this syntax, the “else” clause is going to remain hidden unless the Boolean expression ends up being false. It is there if the process needs it or the value comes out false, but if the value is true, the first statement is going to be used and the second one will be ignored completely.

The “if else” clause is one that a lot of beginners won’t use. They think that it is too complicated and won’t help them to get things done. They want to stick with just the “if” clause and assume that it is the best option for getting things done. But for those who want to have a lot of options with their statements, or who want different options to show up depending on the answers that are given, using the “if else” clause is going to be one of the best options that you can use.

It isn’t that hard of one to understand. It just provides you some more options than you will find with the other choices. After you get some time to experiment with the “if” clauses, make sure that you work on getting used to the “if else” clauses so that you can bring your new codes to a whole new level.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.