WHAT IS THE DIFFERENCE BETWEEN NUM==5 AND NUM=5
Answers
Answered by
3
Hi there!
Here's the answer
In C,
'=' is an assignment operator.
eg: NUM= 5
Here, the value '5' is assigned(copied/stored) to the variable 'NUM'
And
'==' is an equality operator.
It compares the values on either side of its symbol '=='.
eg: NUM==5
Here, value in the variable 'NUM' is compared with constant '5'.
This equality operators is mostly used in programming when to go inside a loop and execute as per the equality condition.
Eg:
:
:
:
if(x===5)
{
// commands Inside of loop
}
:
:
;
;)
hope it helps
Comment if you need to clear anything
Here's the answer
In C,
'=' is an assignment operator.
eg: NUM= 5
Here, the value '5' is assigned(copied/stored) to the variable 'NUM'
And
'==' is an equality operator.
It compares the values on either side of its symbol '=='.
eg: NUM==5
Here, value in the variable 'NUM' is compared with constant '5'.
This equality operators is mostly used in programming when to go inside a loop and execute as per the equality condition.
Eg:
:
:
:
if(x===5)
{
// commands Inside of loop
}
:
:
;
;)
hope it helps
Comment if you need to clear anything
VemugantiRahul:
kk
Similar questions