What is the difference between = and == in C?
Answers were Sorted based on User's Feedback
Answer / aman
* First of all = is a assignment operator and == is a comparision operator.
* = operator is used to assign value to a variable and == operator is used to compare two variable or constants.
* The left side of = operator can not be a constant, while for == operator both sides can be operator.
http://www.cplusplus.com/forum/general/18183/
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / datta khilari
= operator is assignment operator
== is operator comparision two values
| Is This Answer Correct ? | 4 Yes | 2 No |
Answer / kiranmai
= is used to assign the value it is called assignment operator where as
== is used to compare whether the left side and right side values are equal or not
| Is This Answer Correct ? | 0 Yes | 0 No |
'=' assigns a value to a variable whereas '==' checks whether two values are equal or not
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / nashiinformaticssolutions
=: Assignment operator (e.g., x = 10).
==: Equality comparison operator (e.g., if (x == 10)).
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / nashiinformaticssolutions
== checks equality; = assigns values.
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / glibwaresoftsolutions
=: Assignment operator (e.g., x = 10).
==: Equality comparison operator (e.g., if (x == 10)).
| Is This Answer Correct ? | 0 Yes | 0 No |
=: Assignment operator (e.g., x = 10).
==: Equality comparison operator (e.g., if (x == 10)).
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / varsha vilas kalebag
== assignment operator
= equal to
| Is This Answer Correct ? | 8 Yes | 17 No |
Explain the properties and principles of oop.
What is the equivalent of Pascal's Real a) unsigned int b) float c) char
What is the limitation of cin while taking input for character array?
Is java easier than c++?
Why c++ is created?
Write a function which takes a character array as input and reverses it in place.
2 Answers Lehman Brothers, Vision Infotech,
What are the uses of c++ in the real world?
Explain one-definition rule (odr).
When is the last time you coded in C/C++? What is the most lines of original C/C++ code you have personally written in one project? How confident are you in your ability to write C or C++ without a reference?
Comment on assignment operator in c++.
How do you add an element to a set in c++?
What is long in c++?