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

Answer Posted / sagar pce

1.> = is an Assignment operator
whereas == is an Comparision or Equality operator
2.> If we go for the = operator the value will be same for
both side i.e; X=Y
for eg. if X=7 then Y=7
but when we go for the == operator the value will show the
result as a true or false
for eg. if X==7 and Y==7
then it return TRUE

Is This Answer Correct ?    13 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why isn't sizeof for a struct equal to the sum of sizeof of each member?

533


What are static variables?

613


Explain selection sorting. Also write an example.

577


When does a 'this' pointer get created?

614


Write about c++ storage classes?

740






Will a catch statement catch a derived exception if it is looking for the base class?

554


Write bites in Turbo c++ Header ("Include") Files.

676


What is the insertion operator and what does it do?

561


What is an accessor in c++?

614


What is a catch statement?

577


Do we have to use initialization list in spite of the assignment in constructors?

561


Is set c++?

565


How do I run c++?

570


Is dev c++ free?

610


What is an undefined behavior and sequence points

559