The main format of the conditional statements if is as follows:
if (Boolean expression)
{
Body of the conditional statement;
}
The Boolean expression can be a Boolean variable or Boolean logical expression. Boolean expressions cannot be integer (unlike other programming languages like C and C++).
The body of the statement is the part locked between the curly brackets ( { } ). It may consist of one or more operations (statements). When there are several operations, we have a complex block operator.
|
In C#, as in most of the programming languages there is a conditional statement with else clause: the if-else statement. Its format is the following:
if (Boolean expression)
{
Body of the conditional statement;
}
else
{
Body of the else statement;
}
|
It's a special area where you can find special questions and answers for CSE students or IT professionals. Also, In this section, we try to explain a topic in a very deep way.