- 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
59 Lectures 8.5 hours
68 Lectures 8 hours
Both addition and concatenation use the same + operator, but they are not same. Concatenation is used to concatenate i.e. add strings, whereas simple addition adds numbers.
Let us see an example showing adding numbers and adding strings. Both show different results −
<!DOCTYPE html> <html> <body> <script> var val1 = 30 + "25"; document.write(val1+"<br>"); var val2 = 30 + 25; document.write(val2); </script> </body> </html>
- Addition and Concatenation in Java
- Addition and Concatenation in C#
- Find two numbers with sum and product both same as N in C++
- How to concatenate strings using both GROUP_CONCAT() and CONCAT() in the same MySQL query?
- Find two numbers with sum and product both same as N in C++ Program
- C++ program to find two numbers with sum and product both same as N
- Are identifiers hello and Hello same in Java?