if (x==(x-x+x)) { cout <<" Equal "; } else { cout <<" Not Equal "; } | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

if (x==(x-x+x)) { cout <<" Equal "; } else { cout <<" Not Equal "; }

A. Equal B. Not Equal C. Error D. None

19th Apr 2017, 5:27 AM
Code Gun
Code Gun - avatar
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
19th Apr 2017, 5:30 AM
Ghauth Christians
Ghauth Christians - avatar
+ 2
i prints equal.because it satisfies if condition
3rd May 2017, 11:15 AM
CHISTI JALAJAKSHI
CHISTI JALAJAKSHI - avatar