Interview answers verified by specialists.

Find interview questions and answers on this website:


See right interview answers on 30 common job interview questions

Give a Nested "if" Statements example ?

Here is an example of using nested if structures:
int first = 5;
int second = 3;
if (first == second)
{
Console.WriteLine("These two numbers are equal.");
}
else
{
if (first > second)
{
Console.WriteLine("The first number is greater.");
}
else
{
Console.WriteLine("The second number is greater.");
}
}
In the example above we have two numbers and compare them in two steps: first we compare whether they are equal and if not, we compare again, to determine which one is the greater. Here is the result of the execution of the code above:
The first number is greater.

Do you know that?

30% freelancers generate income from other solo work Next

Articles:

Fast Payments
Payoneer sing up to get free 
$25