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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what is class definition in c++ ?

599


Write a program which is required to process the time of a clock in hours and minutes, entered from the keyboard. With this program, there are two requirements for any data entered by a user: 1. The data must be of the correct type (in this case, two ints). 2. The data must be in the correct range: this means that, for the minutes, negative numbers and any number above 59 must be rejected; for the hours, negative numbers and any number above 23 must be rejected. Output error message for invalid data input. Output the time one and a half hour after the time input. i.e. Hour: 22 Min: 32 One and a half hour after 22:32 is 00:02

1514


Mention the storage classes in c++.

651


How long it will take to learn c++?

618


what are the events occur in intr activated on interrupt vector table

1182






What is iostream in c++ used for?

551


What is the difference between an external iterator and an internal iterator?

614


What is c++ manipulator?

556


Explain what is polymorphism in c++?

629


Draw a flow chart and write a program for the difference between the sum of elements with odd and even numbers. Two dimensional array.

5899


Mention the ways in which parameterized can be invoked. Give an example of each.

576


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

688


Will rust take over c++?

598


What type of question are asked in GE code writing test based on c++ data structures and pointers?

3513


Explain what are mutator methods in c++?

572