mercredi 19 juillet 2017

If condition A is matched, condition B needs to be matched in order to do action C.

I'm not sure how to describe my question, so that, I'm not able to find out the solutions by searching in SO. If there are already similar posts exists, please let me know and i will try to close my post. Sorry to break the rule or if I did anythings wrong.

My question is:

If (condition A)
{
    if(condition B)
      {
         do action C
      }
    else
      ...
}
else
{
   do action C
}

is it possible to just write the code of action C one time instead of two times?

Aucun commentaire:

Enregistrer un commentaire