- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
The increment (++) and decrement (---) operators should be avoided since it can lead to unexpected results. Here are some of the conditions −
In an assignment statement, it can lead to unfavorable results −
<html> <body> <script> var a = 5; var b = ++a; var c = a++; var d = ++c; document.write(a); document.write("\r"+b); document.write("\r"+c); document.write("\r"+d); </script> </body> </html>
Whitespace between the operator and variable can also lead to unexpected results −
a = b = c = 1; ++a ; b -- ; c;
- Why we should use set.seed in R?
- Why should we use MySQL CASE Statement?
- What is SciPy and why should we use it?
- Why we should use whole string in Java regular expression
- Why should I use Hubspot?
- Why should we not store a number into a MySQL ENUM column?
- Why should we use a StringBuffer instead of a String in Java?
- Why should we not use group functions with non-group fields without GROUP BY clause in MySQL SELECT query?
- Why we do not import a package while we use any string function?