+ 1
if (x==(x-x+x)) { cout <<" Equal "; } else { cout <<" Not Equal "; }
A. Equal B. Not Equal C. Error D. None
2 Answers
+ 6
Equal
Always add a value to "x" to understand the code better:
Example (C++):
if (1==(1-1+1))
{
cout <<" Equal ";
} else
{
cout <<" Not Equal ";
}
//First solve those in parenthesis
// 1 - 1 = 0
// 0 + 1 = 1
// 1 == 1 is true
+ 2
i prints equal.because it satisfies if condition