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 |
Write a program to find the reverse Fibonacci series starting from N.
Define upcasting.
How would you differentiate between a pre and post increment operators while overloading?
What is class in c++ with example?
Describe linked list using C++ with an example.
What's the order in which the local objects are destructed?
How does the copy constructor differ from the assignment operator (=)?
How to implement flags?
write a program that withdrawals,deposits,balance check,shows mini statement. (using functions,pointers and arrays)
Explain polymorphism?
Does dev c++ support c++ 11?
Explain explicit container.