Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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 / anita sachdeva

= operator in C language is used to assign the value of
right-hand side value/variable/expression to the left hand
side variable.

== operator in C/C++ language is used to check the value of
left hand variable/expression with the right hand
variable/expression. whether the two values are equal or
not. It returns true if these are equal else it will return
false.

Is This Answer Correct ?    312 Yes 21 No

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

Answer / dee

=----->assignment
== --->comparision

Is This Answer Correct ?    169 Yes 21 No

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

Answer / sunita

1. First of all = is a assignment operator and == is a
comparision operator
2.= give you the same vale like x=y means if x=5 then y=5
on the otehr hand if x==y then it will give you the true or
false
eg if x==5
y==5
then return true

Is This Answer Correct ?    98 Yes 16 No

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

Answer / srabani

= it is used to assign a variable
== it is used to comparison of vale

Is This Answer Correct ?    56 Yes 10 No

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

Answer / chandan

= Assignment Operator
== Comparision Operator

One Intresting Difference between these two is in the =
operator the left side can not be a const, while in == we
can place Const in either side.
eg. x = 5 //correct
5 = x // Incorrect

but X == 5 // CORRECT
5 == X // Correct and Preffered to use left value
as constant to avoid the unwanted bug.

Is This Answer Correct ?    46 Yes 7 No

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

Answer / k.s. karthick prabu

= is the assigment operator

=is used to copy
ex:
a=5 means, copy just that value for 'a'.
== is comparision operator
ex:

#include<stdio.h>
void main()
{
int a;
scanf("%d",&a);
if(a==5)
printf("welcome");
else
printf("if the is not equal to 5");
}

Is This Answer Correct ?    37 Yes 7 No

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

Answer / mallika

= is used to assign the values to the variables.

Eg:- int a=5,b;
b=a;

== is used for comparison purpose.

Eg:- if(a==b)
continue;

Is This Answer Correct ?    31 Yes 6 No

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

Answer / vaibhav meena

= is assignment operator. It is used to assigne a value to a
variable.
and == is a comparison operator is is used to compare to values.

Is This Answer Correct ?    27 Yes 5 No

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

Answer / nila

= this is assignment operator.it is used to assign a
variable to variable and assign a value to variable.
== this is comparison iperator.it is used to compare any
two variable and values.

Is This Answer Correct ?    16 Yes 2 No

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

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

More C++ General Interview Questions

Explain the benefits of proper inheritance.

0 Answers  


Distinguish between a # include and #define.

0 Answers  


what is pre-processor in C++?

0 Answers  


Why is it necessary to use a reference in the argument to the copy constructor?

0 Answers  


What is :: operator in c++?

0 Answers  


Explain operator overloading.

0 Answers  


What is a multiset c++?

0 Answers  


What's the most powerful programming language?

0 Answers  


What is the use of :: operator in c++?

0 Answers  


Does c++ have string data type?

0 Answers  


How are virtual functions implemented in c++?

0 Answers  


What are the differences between the function prototype and the function defi-nition?

0 Answers  


Categories