what is the use of == | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

what is the use of ==

28th Sep 2016, 6:13 AM
Suprotik Roy
Suprotik Roy - avatar
4 Answers
+ 3
== is the equality operator,i.e., it is a relational operator. It checks whether the value assigned to the variable is the value you are thinking or not. For eg. int a =2; if (a==8) cout<<"The value is 8"; else cout<<"the value is not 8"; Hope it is useful.
28th Sep 2016, 6:38 AM
Devansh Kaushik
Devansh Kaushik - avatar
+ 1
== is the equality operator in C++ language. for example: we give 5 to a and b. so we can write a==b. (a=5; b=5; a==b;)
28th Sep 2016, 6:43 AM
Vahid Borji
Vahid Borji - avatar
+ 1
==is the equality operator for example {int a; cout<<"enter any number"; cin>>a; if(a==0) cout<<"the value is zero"; else cout<<"the value is not zero"; }
28th Sep 2016, 1:30 PM
kumar
+ 1
it is used to compare the values of two variables or variable and constant
4th Oct 2016, 5:27 PM
K.S. Chaithanya
K.S. Chaithanya - avatar