What is the difference between = and == in C?

Answers were Sorted based on User's Feedback



What is the difference between = and == in C?..

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

What is the difference between = and == in C?..

Answer / datta khilari

= operator is assignment operator

== is operator comparision two values

Is This Answer Correct ?    4 Yes 2 No

What is the difference between = and == in C?..

Answer / balveer

give the new ans

Is This Answer Correct ?    8 Yes 7 No

What is the difference between = and == in C?..

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

What is the difference between = and == in C?..

Answer / idofsaikat9

'=' assigns a value to a variable whereas '==' checks whether two values are equal or not

Is This Answer Correct ?    0 Yes 0 No

What is the difference between = and == in C?..

Answer / varsha vilas kalebag

== assignment operator
= equal to

Is This Answer Correct ?    8 Yes 17 No

Post New Answer

More C++ General Interview Questions

Describe friend function & its advantages.

0 Answers   TCS,


What is struct c++?

0 Answers  


What is a modifier in c++?

0 Answers  


What does it mean to declare a member function as static?

0 Answers  


I was a c++ code and was asked to find out the bug in that. The bug was that he declared an object locally in a function and tried to return the pointer to that object. Since the object is local to the function, it no more exists after returning from the function. The pointer, therefore, is invalid outside.

0 Answers  






Why do we use pointers in c++?

0 Answers  


What are friend classes? What are advantages of using friend classes?

0 Answers  


What is a far pointer? where we use it?

0 Answers  


What happens when you make call 'delete this;'?

0 Answers  


What are dynamic type checking?

0 Answers  


Why c++ is created?

0 Answers  


Define whitespace in C++.

0 Answers   HCL,


Categories