lundi 19 septembre 2016

A confusion in the working of if condition statement in C#

I am confused with the following piece of code

bool i_am = true;
int he_is= 0;
if ((!i_am? false : he_is> 0))
    Console.WriteLine("Condition is true.....");

i have tested tried all possible ways to understand by testing it with different possibilities of i_am and he_is but still am not able to find the logic.

Tried removing one set of the braces "()" and it produces a different output.

I am a beginner in C#,could anyone please help me with the flow of code in this condition statement. Thank you in Advance.

Aucun commentaire:

Enregistrer un commentaire