Computer Science, asked by Nandanichaurasia, 6 months ago

diffrentiate between a==2 and a=2​

Answers

Answered by keziah54
3

Answer:

A = 2

You have just created a variable, which means, A, willbe acted upon by the code as if it was 2.

Example: A * 6 = 12

A == 2

This is a comparison, which is asking, 'Is A the same as 2'

If A=2, then A==2 is a true statement.

If A = anything else, then A ==2 is a false statement

Explanation:

hope this helps you

Answered by Mister360
2

Explanation:

  • First "=" is used to assign the value. Example: a= 2, then value of a is 2.
  • Second "==" is to show equality between values, Example a == 2, here the value of 2 equal to a.
Similar questions