Hi, I'm having trouble understanding the answer to this question. What is the value of x after this code?
int x = 1;
if (x == 1)
x = x + 1;
else
x = x + 3;
x = 3 * x;
So if I am understanding this correctly, initially x=1, it goes through the if loop and checks if x is 1, if it is, then the new x is equal to 1+1=2. but i am confused on the else part. Can someone please explain to me what happens? Thank you.