+ 2
Please explain about precedence of operators.
I have not been able to understand this help.
4 Respuestas
+ 3
If you have attended second grade in school, you might have already learnt some.
This:
2 + 3 * 5
equals 17, not 25, because multiplication happens first.
Multiplication has higher precedence, therefore it happens first.
But here is an improvised 'table':
Parentheses ()
Increment/decrement ++ / --
Multiplication/division * / /
Addition/subtraction + / -
Assignment =, +=, *=, ...
Comparison operators ==, >, !=, ...
Logical operators &, &&, |, ...
There are of course lots more, but you can probably look it up yourself
+ 3
Thanks but I have passed second grade. Lol
+ 2
Precedence of operators is simply the chronology a compiler will follow while executing a program. Different operators have different preferences when it comes to programs.. some have a higher affinity as compared to others.
0
How do I learn logic of any program