Computer Science, asked by aabbaan393, 1 month ago

What is the result of the following: 1=2

Answers

Answered by singhanshuman1020
0

Answer:

As the question in in Computer Science section

So, i will answer it according to that,

The '=' sign is assignment operator so there is typo, and if its 1==2 then output is false.

Mark as brainliest only if it helped you!

Answered by krishna210398
0

Answer:

The '=' sign is assignment operator , and if its 1==2 then output is false.

Explanation:

Arithmetic Operators:

Symbol Operation Usage Explanation

+ addition x+y Adds values on either side of the operator

- subtraction x-y Subtracts the right hand operand from the left hand operand

* multiplication x*y Multiplies values on either side of the operator

/ division x/y Divides the left hand operand by the right hand operand

% modulus x%y Divides the left hand operand by the right hand operand and returns remainder

Relational Operators: These operators are used for comparison. They return either true or false based on the comparison result. The operator '==' should not be confused with '='. The relational operators are as follows:

Symbol Operation Usage Explanation

== equal x == y Checks if the values of two operands are equal or not, if yes then condition becomes true.

!= not equal x != y Checks if the values of two operands are equal or not, if values are not equal then condition becomes true.

> greater than x > y Checks if the value of the left operand is greater than the value of the right operand, if yes then condition becomes true

< less than x < y Checks if the value of the left operand is less than the value of the right operand, if yes then condition becomes true.

>= greater than or equal x >= y Checks if the value of the left operand is greater than or equal to the value of the right operand, if yes then condition becomes true.

<= less than or equal x <= y Checks if the value of the left operand is less than or equal to the value of the right operand, if yes then condition becomes true.

Bitwise Operators: These operators are very useful and we have some tricks based on these operators. These operators convert the given integers into binary and then perform the required operation, and give back the result in decimal representation.

Symbol Operation Usage Explanation

& bitwise AND x & y Sets the bit to the result if it is set in both operands.

| bitwise OR x | y Sets the bit to the result if it is set in either operand.

^ bitwise XOR x ^ y Sets the bit if it is set in one operand but not both

~ bitwise NOT ~x Unary operator and has the effect of 'flipping' bits,i.e, flips 1 to 0 and 0 to 1.

<< left shift x << y The left operand's value is moved left by the number of bits specified by the right operand. It is equivalent to multiplying x by

>> right shift x >> y The left operand's value is moved right by the number of bits specified by the right operand.It is equivalent to dividing x by

What is the result of the following: 1=2

Logical Operators: These operators take boolean values as input and return boolean values as output.

Note: In C,C++ any non-zero number is treated as true and 0 as false but this doesn't hold for Java.

Symbol Operation Usage Explanation

&& logical AND x && y Returns true if both x and y are true else returns false.

|| logical OR x || y Returns false if neither x nor y is true else returns true

! logical NOT ! x Unary operator. Returns true if x is false else returns false.

Assignment Operators:

Symbol Operation Usage Equivalence Explanation

= assignment x = y  Assigns value from the right side operand(s) to the left side operand.

+= add and assignment x += y x = x+y Adds the right side operand to the left side operand and assigns the result to the left side operand.

-= subtract and assignment x -= y x= x-y Subtracts the right side operand from the left side operand and assigns the result to the left side operand.

*= multiply and assignment x *= y x= x*y Multiplies the right side operand with the left side operand and assigns the result to the left side operand.

/= divide and assignment x /= y x= x/y Divides the left side operand with the right side operand and assigns the result to the left side operand.

%= modulus and assignment x%=y x= x%y Takes modulus using the two operands and assigns the result to the left side operand.

<<= left shift and assignment x<<=y x= x<< y Shifts the value of x by y bits towards the left and stores the result back in x.

>>= right shift and assignment x>>=y x= x>>y Shifts the value of x by y bits towards the right and stores the result back in x.

&= bitwise AND and assignment x&=y x= x&y Does x&y and stores result back in x.

|= bitwise OR and assignment x|=y x= x|y Does x|y and stores result back in x

^= bitwise XOR and assignment x^=y x= x^y Does x^y and stores result back in x.

Increment/Decrement Operators: These are unary operators. Unary operators are the operators which require only one operand.

Symbol Operation Usage Explanation

++ Postincrement x++ Increment x by 1 after using its value

-- Postdecrement x-- Decrement x by 1 after using its value

++ Preincrement ++x Increment x by 1 before using its value

-- Predecrement --x Decrement x by 1 before using its value

What is the result of the following: 1=2

https://brainly.in/question/41879100

What is assignment operator

https://brainly.in/question/7010347

#SPJ2

Similar questions