dimanche 30 octobre 2016

Wrong written "if-statement" causes and consequences

So I know that the correct way is:

    if (x > y)
    {
        //...
    }
    else if (x = y)
    {
        //...
    }
    else 
    {
        //...
    }

Or for example if I want specific condition for last condition:

    if (x > y)
    {
        //...
    }
    else if (x = y)
    {
        //...
    }
    else 
    {
        if (x < y)
        {
            //...
        }
    }

But if it is wrong, like this one:

    if (x > y)
    {
        //...
    }
    else if (x = y)
    {
        //...
    }
    else if (x < y)
    {
        //...
    }

My question is why last one is wrong and what kind of failure it can cause?

For example, can it be cause of multiplication of process in last condition in if-statement?

Aucun commentaire:

Enregistrer un commentaire