- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
C# Numeric Promotion
Numeric promotion as the name suggests is the promotion of smaller types to larger types like short to int.
In the below example, we have seen numeric promotion in Arithmetic Operator multiply.
The short types are automatically promoted to larger types −
Example
using System; class Program { static void Main() { short val1 = 99; ushort val2 = 11; int res = val1 * val2; Console.WriteLine(res); } }
Advertisements