Explain the difference between 1 and 2 and give the value for x in both when x is 1.
1)
if ( x >= 0)
x = x + 1;
else if ( x >= 1)
x = x + 2;
2)
if ( x >= 0)
x = x + 1;
if ( x >= 1)
x = x + 2;
I came up with they're are both the same and x simply would be 3 for both of them. Im almost sure I am wrong however I feel like i don't fully understand the entire concept of why, can anyone give me the x value for both and explain how they are different ( minus the obvious that one says else).