Computer Science, asked by sairoshan1202, 1 year ago

WHAT IS THE DIFFERENCE BETWEEN NUM==5 AND NUM=5

Answers

Answered by VemugantiRahul
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

VemugantiRahul: kk
VemugantiRahul: folo me
sairoshan1202: yaaaa....
VemugantiRahul: telugu valle leru ikda
VemugantiRahul: evar adgna bihar bengal
sairoshan1202: atlana
VemugantiRahul: enti atlana
sairoshan1202: so bye i have to prepare for my exams and tomorrow is the last and i have to score that subject any how i am the topper of my class
VemugantiRahul: ok prepare well
VemugantiRahul: all d best for exam dude
Similar questions