jeudi 29 novembre 2018

Combine conditions in an inner if statement with the outer else statement - C#

I have three conditions (a, b, c) to be checked that's supposed to run on the folliwing syntax:

if (conditionA)
{
    if (conditionB && conditionC)
    {
        // Execute();
    }
}
else if (conditionC)
{
    // Execute();
}

Better still, can these conditions be simplified to one line, so that Execute() will end up in one set of braces? Thanks.

Aucun commentaire:

Enregistrer un commentaire