English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Im still a bit confused about the (=) and the (==) can somebody help out.

2007-03-23 13:09:40 · 4 answers · asked by Anonymous in Computers & Internet Programming & Design

Thank you for all your information.
Much obliged to you all.

2007-03-23 13:35:28 · update #1

4 answers

the "=" is for assigning a value for a variable while the "==" is a symbol for comparing two variable.

ex.

n=1
*this statement tells that n gets the value 1.

n == x
*this statement checks if n is equal to x

hope this helps.

2007-03-23 13:19:33 · answer #1 · answered by tb_ramon2 2 · 1 0

"=" means your assigning something.
for example
int x = 25;
so now the variable holds the value 25.

"==" is used when your comparing two things.

if (x == 25) //if x equals 25
return true;

2007-03-23 20:18:45 · answer #2 · answered by blazeimurill 3 · 1 0

' = ' is an assignment operator
' == ' is a logical operator used to check if two values are equal

int y = 9; you assign 9 as a value of y
x==y; logical operator that checks if x is equal to y

2007-03-23 22:26:04 · answer #3 · answered by ru_bled1010 2 · 0 0

= assigns a value to a variable, == is used to check a variable for a certain value.

2007-03-23 20:17:22 · answer #4 · answered by Anonymous · 1 0

fedest.com, questions and answers